chiark / gitweb /
Parse /top.old with id and when requesting diffs
authorPaolo \'Blaisorblade\' Giarrusso <blaisorblade@yahoo.it>
Thu, 27 Oct 2005 08:56:22 +0000 (10:56 +0200)
committerCatalin Marinas <catalin.marinas@gmail.com>
Thu, 27 Oct 2005 19:47:12 +0000 (20:47 +0100)
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

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 <blaisorblade@yahoo.it>
stgit/commands/common.py
stgit/stack.py

index f9e2a280a8ccd88495f0d480e03ad169f5097a2d..575aae7c8868ebfd3cb1d241ad8457d2d1bb94a8 100644 (file)
@@ -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:
index 33c6d83d52f511e3fdbfecd7e81507ef21643b8e..c7cbdc59ba3c337ff261ff04fbb8d87e81dac43a 100644 (file)
@@ -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')