Ask vim to avoid backup copies of .stgit.msg
[stgit] / stgit / commands / common.py
index 7a9df6e..575aae7 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:
@@ -92,8 +97,12 @@ def check_conflicts():
     if os.path.exists(os.path.join(git.base_dir, 'conflicts')):
         raise CmdException, 'Unsolved conflicts. Please resolve them first'
 
-def print_crt_patch():
-    patch = crt_series.get_current()
+def print_crt_patch(branch = None):
+    if not branch:
+        patch = crt_series.get_current()
+    else:
+        patch = stack.Series(branch).get_current()
+
     if patch:
         print 'Now at patch "%s"' % patch
     else: