From: Paolo \'Blaisorblade\' Giarrusso Date: Thu, 27 Oct 2005 08:56:22 +0000 (+0200) Subject: Parse /top.old with id and when requesting diffs X-Git-Tag: v0.8~57 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/54b095847e7d97697bde6d0beca7b6b9a67e9590?ds=sidebyside Parse /top.old with id and when requesting diffs From: Paolo 'Blaisorblade' Giarrusso Comparing a patch after and before a merge is very important, and looking into .git/patches by hand is not the nicer way to do it. Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- diff --git a/stgit/commands/common.py b/stgit/commands/common.py index f9e2a28..575aae7 100644 --- a/stgit/commands/common.py +++ b/stgit/commands/common.py @@ -68,6 +68,11 @@ def git_id(string): return series.get_patch(patch_name).get_top() elif patch_id == 'bottom': return series.get_patch(patch_name).get_bottom() + # Note we can return None here. + elif patch_id == 'top.old': + return series.get_patch(patch_name).get_old_top() + elif patch_id == 'bottom.old': + return series.get_patch(patch_name).get_old_bottom() # base if patch_name == 'base' and len(string_list) == 1: diff --git a/stgit/stack.py b/stgit/stack.py index 33c6d83..c7cbdc5 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -165,6 +165,9 @@ class Patch: elif os.path.isfile(fname): os.remove(fname) + def get_old_bottom(self): + return self.__get_field('bottom.old') + def get_bottom(self): return self.__get_field('bottom') @@ -177,6 +180,9 @@ class Patch: self.__set_field('bottom.old', None) self.__set_field('bottom', string) + def get_old_top(self): + return self.__get_field('top.old') + def get_top(self): return self.__get_field('top')