diff hgext/mq.py @ 4409:28b7d949ef6a

Merge with crew-stable. HG: changed hgext/mq.py
author Patrick Mezard <pmezard@gmail.com>
date Mon, 07 May 2007 00:12:35 +0200
parents 15289406f89c f700ea2b0689
children 94cb7561337d
line wrap: on
line diff
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1303,6 +1303,10 @@ class queue:
         return 0
 
     def series_end(self, all_patches=False):
+        """If all_patches is False, return the index of the next pushable patch
+        in the series, or the series length. If all_patches is True, return the
+        index of the first patch past the last applied one.
+        """
         end = 0
         def next(start):
             if all_patches:
@@ -1589,7 +1593,7 @@ def series(ui, repo, **opts):
 def top(ui, repo, **opts):
     """print the name of the current patch"""
     q = repo.mq
-    t = q.series_end()
+    t = q.applied and q.series_end(True) or 0
     if t:
         return q.qseries(repo, start=t-1, length=1, status='A',
                          summary=opts.get('summary'))