chiark / gitweb /
Allow print_crt_patch to work on other branches
authorChuck Lever <cel@netapp.com>
Thu, 6 Oct 2005 10:20:14 +0000 (11:20 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Thu, 6 Oct 2005 10:20:14 +0000 (11:20 +0100)
print_crt_patch() current prints the current patch in the current branch.
Add a function argument to allow it to print the current patch in other
branches.

Signed-off-by: Chuck Lever <cel@netapp.com>
stgit/commands/common.py

index 7a9df6ead4cb623be50e4ccc43d8ef1efe2a9b56..f9e2a280a8ccd88495f0d480e03ad169f5097a2d 100644 (file)
@@ -92,8 +92,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: