##// END OF EJS Templates
mq: make qprev return the previous applied patch (issue3245)...
Patrick Mezard -
r16064:7e5a281a stable
parent child Browse files
Show More
@@ -2217,7 +2217,7 b' def next(ui, repo, **opts):'
2217
2217
2218 @command("qprev", seriesopts, _('hg qprev [-s]'))
2218 @command("qprev", seriesopts, _('hg qprev [-s]'))
2219 def prev(ui, repo, **opts):
2219 def prev(ui, repo, **opts):
2220 """print the name of the previous patch
2220 """print the name of the previous applied patch
2221
2221
2222 Returns 0 on success."""
2222 Returns 0 on success."""
2223 q = repo.mq
2223 q = repo.mq
@@ -2228,7 +2228,8 b' def prev(ui, repo, **opts):'
2228 if not l:
2228 if not l:
2229 ui.write(_("no patches applied\n"))
2229 ui.write(_("no patches applied\n"))
2230 return 1
2230 return 1
2231 q.qseries(repo, start=l - 2, length=1, status='A',
2231 idx = q.series.index(q.applied[-2].name)
2232 q.qseries(repo, start=idx, length=1, status='A',
2232 summary=opts.get('summary'))
2233 summary=opts.get('summary'))
2233
2234
2234 def setupheaderopts(ui, opts):
2235 def setupheaderopts(ui, opts):
@@ -172,6 +172,8 b' should push b.patch'
172 $ hg qpush -a
172 $ hg qpush -a
173 applying c.patch
173 applying c.patch
174 now at: c.patch
174 now at: c.patch
175 $ hg qprev
176 b.patch
175
177
176 Used to be an issue with holes in the patch sequence
178 Used to be an issue with holes in the patch sequence
177 So, put one hole on the base and ask for topmost patch.
179 So, put one hole on the base and ask for topmost patch.
@@ -74,7 +74,7 b' help'
74 qnew create a new patch
74 qnew create a new patch
75 qnext print the name of the next pushable patch
75 qnext print the name of the next pushable patch
76 qpop pop the current patch off the stack
76 qpop pop the current patch off the stack
77 qprev print the name of the previous patch
77 qprev print the name of the previous applied patch
78 qpush push the next patch onto the stack
78 qpush push the next patch onto the stack
79 qqueue manage multiple patch queues
79 qqueue manage multiple patch queues
80 qrefresh update the current patch
80 qrefresh update the current patch
General Comments 0
You need to be logged in to leave comments. Login now