X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/29f005891588edee926512a03710672f43c21183..73e2d98ea8bb1cae1c8d8b0cbdede66b26a05da6:/stgit/stack.py diff --git a/stgit/stack.py b/stgit/stack.py index 9ccbb1e..e1c55f0 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -629,7 +629,8 @@ class Series: unapplied = False, show_patch = False, top = None, bottom = None, author_name = None, author_email = None, author_date = None, - committer_name = None, committer_email = None): + committer_name = None, committer_email = None, + before_existing = False): """Creates a new patch """ if self.__patch_applied(name) or self.__patch_unapplied(name): @@ -672,8 +673,13 @@ class Series: f.writelines([line + '\n' for line in patches]) f.close() else: - append_string(self.__applied_file, patch.get_name()) - self.__set_current(name) + if before_existing: + insert_string(self.__applied_file, patch.get_name()) + if not self.get_current(): + self.__set_current(name) + else: + append_string(self.__applied_file, patch.get_name()) + self.__set_current(name) def delete_patch(self, name): """Deletes a patch