X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/8351555474ced37a21799755762ad69b3c826d70..fe847176ac839e64d426e6bf8ab7ad67ba3129d6:/stgit/stack.py diff --git a/stgit/stack.py b/stgit/stack.py index f4d7490..c14e029 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -431,8 +431,13 @@ class Series: """ bases_dir = os.path.join(self.__base_dir, 'refs', 'bases') - if self.is_initialised(): + if os.path.exists(self.__patch_dir): raise StackException, self.__patch_dir + ' already exists' + if os.path.exists(self.__refs_dir): + raise StackException, self.__refs_dir + ' already exists' + if os.path.exists(self.__base_file): + raise StackException, self.__base_file + ' already exists' + os.makedirs(self.__patch_dir) if not os.path.isdir(bases_dir):