hgext/mq.py
branchstable
changeset 16064 7e5a281a082c
parent 16063 c36db39b3fee
child 16065 8af9e08a094f
child 16100 24df9338aa01
--- a/hgext/mq.py	Fri Feb 03 19:38:31 2012 +0100
+++ b/hgext/mq.py	Fri Feb 03 19:47:09 2012 +0100
@@ -2217,7 +2217,7 @@
 
 @command("qprev", seriesopts, _('hg qprev [-s]'))
 def prev(ui, repo, **opts):
-    """print the name of the previous patch
+    """print the name of the previous applied patch
 
     Returns 0 on success."""
     q = repo.mq
@@ -2228,7 +2228,8 @@
     if not l:
         ui.write(_("no patches applied\n"))
         return 1
-    q.qseries(repo, start=l - 2, length=1, status='A',
+    idx = q.series.index(q.applied[-2].name)
+    q.qseries(repo, start=idx, length=1, status='A',
               summary=opts.get('summary'))
 
 def setupheaderopts(ui, opts):