X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/fe847176ac839e64d426e6bf8ab7ad67ba3129d6..a22a62b6760b0e1531d783e414c65ada3d1525d6:/stgit/stack.py diff --git a/stgit/stack.py b/stgit/stack.py index c14e029..19bb62a 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -426,7 +426,7 @@ class Series: """ return os.path.isdir(self.__patch_dir) - def init(self): + def init(self, create_at=False): """Initialises the stgit series """ bases_dir = os.path.join(self.__base_dir, 'refs', 'bases') @@ -438,6 +438,9 @@ class Series: if os.path.exists(self.__base_file): raise StackException, self.__base_file + ' already exists' + if (create_at!=False): + git.create_branch(self.__name, create_at) + os.makedirs(self.__patch_dir) if not os.path.isdir(bases_dir): @@ -509,8 +512,7 @@ class Series: """Clones a series """ base = read_string(self.get_base_file()) - git.create_branch(target_series, tree_id = base) - Series(target_series).init() + Series(target_series).init(create_at = base) new_series = Series(target_series) # generate an artificial description file