mq: qpop now tells which patches are popped

When navigating through a patch series by qpushing and qpopping it was easy to
get lost because qpop was silent. I found myself often running qnext after qpop
to see which patch I just dropped - especially if I was about to qrm it. This
patch makes qpop more symmetric to qpush by showing which patches are
applied/"unapplied".

I think it is a good change even though it changes output by adding a new line
of output.
This commit is contained in:
Mads Kiilerich 2009-07-09 23:59:03 +02:00
parent 8939e5b2b0
commit b3ac6d2456
20 changed files with 111 additions and 0 deletions

View File

@ -1080,6 +1080,8 @@ class queue(object):
except: pass except: pass
repo.dirstate.forget(f) repo.dirstate.forget(f)
repo.dirstate.setparents(qp, nullid) repo.dirstate.setparents(qp, nullid)
for patch in reversed(self.applied[start:end]):
self.ui.warn(_("popping %s\n") % patch.name)
del self.applied[start:end] del self.applied[start:end]
self.strip(repo, rev, update=False, backup='strip') self.strip(repo, rev, update=False, backup='strip')
if len(self.applied): if len(self.applied):

View File

@ -210,6 +210,7 @@ diff -r ef63ca68695b -r 40a904bbbe4c c
+$Id$ +$Id$
+tests for different changenodes +tests for different changenodes
% qpop % qpop
popping mqtest.diff
patch queue now empty patch queue now empty
% qgoto - should imply qpush % qgoto - should imply qpush
applying mqtest.diff applying mqtest.diff
@ -218,6 +219,7 @@ now at: mqtest.diff
$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
tests for different changenodes tests for different changenodes
% qpop and move on % qpop and move on
popping mqtest.diff
patch queue now empty patch queue now empty
% copy % copy
% kwfiles added % kwfiles added

View File

@ -5,6 +5,7 @@ tip: 0
No branch cache No branch cache
# some regular revisions # some regular revisions
popping p1
patch queue now empty patch queue now empty
tip: 1 tip: 1
3f910abad313ff802d3a23a7529433872df9b3ae 1 3f910abad313ff802d3a23a7529433872df9b3ae 1
@ -43,6 +44,9 @@ branch bar: 2
qbase: 1 qbase: 1
# detect an invalid cache # detect an invalid cache
popping p2
popping p1
popping p0
patch queue now empty patch queue now empty
applying p0 applying p0
applying p1 applying p1

View File

@ -9,12 +9,14 @@ Hunk #1 FAILED at 0
patch failed, unable to continue (try -v) patch failed, unable to continue (try -v)
patch failed, rejects left in working dir patch failed, rejects left in working dir
errors during apply, please fix and refresh eol.diff errors during apply, please fix and refresh eol.diff
popping eol.diff
patch queue now empty patch queue now empty
% invalid eol % invalid eol
applying eol.diff applying eol.diff
patch failed, unable to continue (try -v) patch failed, unable to continue (try -v)
patch failed, rejects left in working dir patch failed, rejects left in working dir
errors during apply, please fix and refresh eol.diff errors during apply, please fix and refresh eol.diff
popping eol.diff
patch queue now empty patch queue now empty
% force LF % force LF
applying eol.diff applying eol.diff
@ -42,6 +44,7 @@ y<CR><LF>
c<CR><LF> c<CR><LF>
d<CR><LF> d<CR><LF>
z z
popping eol.diff
patch queue now empty patch queue now empty
% push again forcing LF and compare revisions % push again forcing LF and compare revisions
applying eol.diff applying eol.diff
@ -51,6 +54,7 @@ y<CR><LF>
c<CR><LF> c<CR><LF>
d<CR><LF> d<CR><LF>
z z
popping eol.diff
patch queue now empty patch queue now empty
% push again without LF and compare revisions % push again without LF and compare revisions
applying eol.diff applying eol.diff
@ -60,4 +64,5 @@ y<CR><LF>
c<CR><LF> c<CR><LF>
d<CR><LF> d<CR><LF>
z z
popping eol.diff
patch queue now empty patch queue now empty

View File

@ -1,4 +1,7 @@
adding x adding x
popping c.patch
popping b.patch
popping a.patch
patch queue now empty patch queue now empty
% should fail % should fail
abort: no patch named does-not-exist.patch abort: no patch named does-not-exist.patch
@ -9,6 +12,7 @@ now at: a.patch
% should guard a.patch % should guard a.patch
% should print +a % should print +a
a.patch: +a a.patch: +a
popping a.patch
patch queue now empty patch queue now empty
% should fail % should fail
cannot push 'a.patch' - guarded by ['+a'] cannot push 'a.patch' - guarded by ['+a']
@ -16,6 +20,7 @@ a.patch: +a
% should push b.patch % should push b.patch
applying b.patch applying b.patch
now at: b.patch now at: b.patch
popping b.patch
patch queue now empty patch queue now empty
% test selection of an empty guard % test selection of an empty guard
abort: guard cannot be an empty string abort: guard cannot be an empty string
@ -34,6 +39,9 @@ b.patch
% should push c.patch % should push c.patch
applying c.patch applying c.patch
now at: c.patch now at: c.patch
popping c.patch
popping b.patch
popping a.patch
patch queue now empty patch queue now empty
guards deactivated guards deactivated
number of unguarded, unapplied patches has changed from 3 to 2 number of unguarded, unapplied patches has changed from 3 to 2
@ -41,6 +49,8 @@ number of unguarded, unapplied patches has changed from 3 to 2
applying b.patch applying b.patch
applying c.patch applying c.patch
now at: c.patch now at: c.patch
popping c.patch
popping b.patch
patch queue now empty patch queue now empty
number of unguarded, unapplied patches has changed from 1 to 2 number of unguarded, unapplied patches has changed from 1 to 2
% should push a.patch, not b.patch % should push a.patch, not b.patch
@ -48,6 +58,8 @@ applying a.patch
now at: a.patch now at: a.patch
applying c.patch applying c.patch
now at: c.patch now at: c.patch
popping c.patch
popping a.patch
patch queue now empty patch queue now empty
% should push b.patch % should push b.patch
applying b.patch applying b.patch
@ -55,6 +67,8 @@ now at: b.patch
applying c.patch applying c.patch
now at: c.patch now at: c.patch
c.patch c.patch
popping c.patch
popping b.patch
patch queue now empty patch queue now empty
number of unguarded, unapplied patches has changed from 2 to 3 number of unguarded, unapplied patches has changed from 2 to 3
% should push a.patch, b.patch % should push a.patch, b.patch
@ -62,6 +76,8 @@ applying a.patch
now at: a.patch now at: a.patch
applying b.patch applying b.patch
now at: b.patch now at: b.patch
popping b.patch
popping a.patch
patch queue now empty patch queue now empty
number of unguarded, unapplied patches has changed from 3 to 2 number of unguarded, unapplied patches has changed from 3 to 2
% list patches and guards % list patches and guards
@ -83,6 +99,8 @@ applying c.patch
now at: c.patch now at: c.patch
guards deactivated guards deactivated
popping guarded patches popping guarded patches
popping c.patch
popping b.patch
patch queue now empty patch queue now empty
reapplying unguarded patches reapplying unguarded patches
applying c.patch applying c.patch
@ -100,6 +118,7 @@ c.patch
new.patch: +1 +2 -3 new.patch: +1 +2 -3
b.patch: +2 b.patch: +2
c.patch: unguarded c.patch: unguarded
popping d.patch
now at: c.patch now at: c.patch
% should show new.patch and b.patch as Guarded, c.patch as Applied % should show new.patch and b.patch as Guarded, c.patch as Applied
% and d.patch as Unapplied % and d.patch as Unapplied
@ -112,6 +131,7 @@ now at: c.patch
1 G b.patch 1 G b.patch
2 A c.patch 2 A c.patch
3 G d.patch 3 G d.patch
popping c.patch
patch queue now empty patch queue now empty
new.patch: +1 +2 -3 new.patch: +1 +2 -3
b.patch: +2 b.patch: +2

View File

@ -42,6 +42,7 @@ diff -r ... 2
+2 +2
1: [mq]: 2.patch - test 1: [mq]: 2.patch - test
0: [mq]: 1.patch - test 0: [mq]: 1.patch - test
popping 2.patch
now at: 1.patch now at: 1.patch
==== qnew -d -m ==== qnew -d -m
# HG changeset patch # HG changeset patch
@ -127,8 +128,10 @@ diff -r ... 4
2: Four - test 2: Four - test
1: Three (again) - test 1: Three (again) - test
0: [mq]: 1.patch - test 0: [mq]: 1.patch - test
popping 4.patch
now at: 3.patch now at: 3.patch
==== qnew with HG header ==== qnew with HG header
popping 5.patch
now at: 3.patch now at: 3.patch
# HG changeset patch # HG changeset patch
# Date 10 0 # Date 10 0
@ -185,6 +188,7 @@ diff -r ... 6
2: [mq]: 5.patch - test 2: [mq]: 5.patch - test
1: Three (again) - test 1: Three (again) - test
0: [mq]: 1.patch - test 0: [mq]: 1.patch - test
popping 6.patch
now at: 5.patch now at: 5.patch
==== qnew -d ==== qnew -d
adding 7 adding 7
@ -240,6 +244,7 @@ diff -r ... 8
2: [mq]: 5.patch - test 2: [mq]: 5.patch - test
1: Three (again) - test 1: Three (again) - test
0: [mq]: 1.patch - test 0: [mq]: 1.patch - test
popping 8.patch
now at: 7.patch now at: 7.patch
==== qnew -m ==== qnew -m
adding 9 adding 9
@ -270,8 +275,13 @@ diff -r ... 9
2: [mq]: 5.patch - test 2: [mq]: 5.patch - test
1: Three (again) - test 1: Three (again) - test
0: [mq]: 1.patch - test 0: [mq]: 1.patch - test
popping 9.patch
now at: 7.patch now at: 7.patch
==== qpop -a / qpush -a ==== qpop -a / qpush -a
popping 7.patch
popping 5.patch
popping 3.patch
popping 1.patch
patch queue now empty patch queue now empty
applying 1.patch applying 1.patch
applying 3.patch applying 3.patch

View File

@ -131,6 +131,7 @@ diff -r ... 4
1: [mq]: 2.patch - jane 1: [mq]: 2.patch - jane
0: [mq]: 1.patch - mary 0: [mq]: 1.patch - mary
==== qnew with HG header ==== qnew with HG header
popping 5.patch
now at: 4.patch now at: 4.patch
now at: 5.patch now at: 5.patch
# HG changeset patch # HG changeset patch
@ -184,6 +185,11 @@ diff -r ... 5
1: [mq]: 2.patch - jane 1: [mq]: 2.patch - jane
0: [mq]: 1.patch - mary 0: [mq]: 1.patch - mary
==== qpop -a / qpush -a ==== qpop -a / qpush -a
popping 5.patch
popping 4.patch
popping 3.patch
popping 2.patch
popping 1.patch
patch queue now empty patch queue now empty
applying 1.patch applying 1.patch
applying 2.patch applying 2.patch

View File

@ -10,6 +10,8 @@ merging with queue at: .hg/patches.1
applying rm_a applying rm_a
now at: rm_a now at: rm_a
b b
popping rm_a
popping .hg.patches.merge.marker
patch queue now empty patch queue now empty
% init t2 % init t2

View File

@ -1,4 +1,5 @@
adding b adding b
popping changeb
patch queue now empty patch queue now empty
% push patch with missing target % push patch with missing target
applying changeb applying changeb
@ -26,6 +27,7 @@ c
+c +c
+c +c
adding b adding b
popping changeb
patch queue now empty patch queue now empty
% push git patch with missing target % push git patch with missing target
applying changeb applying changeb
@ -48,6 +50,7 @@ Jc${No0000400IC2
% test push creating directory during git copy or rename % test push creating directory during git copy or rename
adding a adding a
popping patch
patch queue now empty patch queue now empty
applying patch applying patch
now at: patch now at: patch

View File

@ -13,6 +13,7 @@ comparing with bundle:fresh+main.hg
1: main: one updated. 1: main: one updated.
====== Setup queue ====== Setup queue
adding two adding two
popping two.patch
patch queue now empty patch queue now empty
====== Bundle queue ====== Bundle queue
1 changesets found 1 changesets found

View File

@ -1,6 +1,7 @@
adding base adding base
abort: qdelete requires at least one revision or patch name abort: qdelete requires at least one revision or patch name
abort: cannot delete applied patch c abort: cannot delete applied patch c
popping c
now at: b now at: b
a a
b b
@ -8,6 +9,7 @@ a
b b
series series
status status
popping b
now at: a now at: a
a a
b b
@ -30,6 +32,7 @@ abort: no revisions specified
no patches applied no patches applied
abort: revision 0 is not managed abort: revision 0 is not managed
abort: cannot delete revision 2 above applied patches abort: cannot delete revision 2 above applied patches
popping c
now at: b now at: b
abort: unknown revision 'c'! abort: unknown revision 'c'!
applying c applying c

View File

@ -26,6 +26,7 @@ diff -r 67e992f2c4f3 base
+patched +patched
% revert % revert
% qpop % qpop
popping mqbase
patch queue now empty patch queue now empty
% qdelete mqbase % qdelete mqbase
% commit 2 % commit 2

View File

@ -1,6 +1,8 @@
% init % init
adding a adding a
% fold in the middle of the queue % fold in the middle of the queue
popping p3
popping p2
now at: p1 now at: p1
--- a/a --- a/a
+++ b/a +++ b/a

View File

@ -1,17 +1,24 @@
adding a adding a
popping c.patch
popping b.patch
now at: a.patch now at: a.patch
applying b.patch applying b.patch
applying c.patch applying c.patch
now at: c.patch now at: c.patch
popping c.patch
now at: b.patch now at: b.patch
% Using index % Using index
popping b.patch
now at: a.patch now at: a.patch
applying b.patch applying b.patch
applying c.patch applying c.patch
now at: c.patch now at: c.patch
% No warnings when using index % No warnings when using index
popping bug141421
popping bug314159
popping c.patch
now at: b.patch now at: b.patch
applying c.patch applying c.patch
applying bug314159 applying bug314159

View File

@ -8,12 +8,14 @@ abort: patch "url.diff" already exists
applying url.diff applying url.diff
now at: url.diff now at: url.diff
foo foo
popping url.diff
patch queue now empty patch queue now empty
% qimport -f % qimport -f
adding url.diff to series file adding url.diff to series file
applying url.diff applying url.diff
now at: url.diff now at: url.diff
foo2 foo2
popping url.diff
patch queue now empty patch queue now empty
% build diff with CRLF % build diff with CRLF
adding b adding b

View File

@ -20,6 +20,9 @@ foo bar
abort: patch "first.patch" already exists abort: patch "first.patch" already exists
abort: patch "first.patch" already exists abort: patch "first.patch" already exists
% qnew -f from a subdirectory % qnew -f from a subdirectory
popping first.patch
popping mtest.patch
popping test.patch
patch queue now empty patch queue now empty
adding d/b adding d/b
M d/b M d/b

View File

@ -1,6 +1,9 @@
adding foo adding foo
% test qpush on empty series % test qpush on empty series
no patches in series no patches in series
popping bad-patch
popping patch2
popping patch1
patch queue now empty patch queue now empty
applying patch1 applying patch1
applying patch2 applying patch2

View File

@ -1,9 +1,11 @@
a -> a not a symlink a -> a not a symlink
a -> b a -> b
popping symlink.patch
now at: base.patch now at: base.patch
applying symlink.patch applying symlink.patch
now at: symlink.patch now at: symlink.patch
a -> b a -> b
popping removesl.patch
now at: symlink.patch now at: symlink.patch
applying removesl.patch applying removesl.patch
now at: removesl.patch now at: removesl.patch

View File

@ -108,16 +108,20 @@ working dir diff:
a a
+a +a
% qpop % qpop
popping test.patch
patch queue now empty patch queue now empty
% qpush % qpush
applying test.patch applying test.patch
now at: test.patch now at: test.patch
% pop/push outside repo % pop/push outside repo
popping test.patch
patch queue now empty patch queue now empty
applying test.patch applying test.patch
now at: test.patch now at: test.patch
% qrefresh in subdir % qrefresh in subdir
% pop/push -a in subdir % pop/push -a in subdir
popping test2.patch
popping test.patch
patch queue now empty patch queue now empty
applying test.patch applying test.patch
applying test2.patch applying test2.patch
@ -125,6 +129,7 @@ now at: test2.patch
% qseries % qseries
test.patch test.patch
test2.patch test2.patch
popping test2.patch
now at: test.patch now at: test.patch
0 A test.patch: foo bar 0 A test.patch: foo bar
1 U test2.patch: 1 U test2.patch:
@ -140,6 +145,7 @@ test.patch
% qnext % qnext
all patches applied all patches applied
% pop, qnext, qprev, qapplied % pop, qnext, qprev, qapplied
popping test2.patch
now at: test.patch now at: test.patch
test2.patch test2.patch
only one patch applied only one patch applied
@ -156,17 +162,24 @@ test2.patch
% qpush/qpop with index % qpush/qpop with index
applying test2.patch applying test2.patch
now at: test2.patch now at: test2.patch
popping test2.patch
popping test1b.patch
now at: test.patch now at: test.patch
applying test1b.patch applying test1b.patch
now at: test1b.patch now at: test1b.patch
applying test2.patch applying test2.patch
now at: test2.patch now at: test2.patch
popping test2.patch
now at: test1b.patch now at: test1b.patch
popping test1b.patch
now at: test.patch now at: test.patch
applying test1b.patch applying test1b.patch
applying test2.patch applying test2.patch
now at: test2.patch now at: test2.patch
% push should succeed % push should succeed
popping test2.patch
popping test1b.patch
popping test.patch
patch queue now empty patch queue now empty
pushing to ../../k pushing to ../../k
searching for changes searching for changes
@ -180,6 +193,9 @@ applying test1b.patch
applying test2.patch applying test2.patch
now at: test2.patch now at: test2.patch
% pops all patches and succeeds % pops all patches and succeeds
popping test2.patch
popping test1b.patch
popping test.patch
patch queue now empty patch queue now empty
qpop -a succeeds qpop -a succeeds
% does nothing and succeeds % does nothing and succeeds
@ -193,6 +209,7 @@ applying test.patch
now at: test.patch now at: test.patch
qpush succeeds qpush succeeds
% pops a patch and succeeds % pops a patch and succeeds
popping test.patch
patch queue now empty patch queue now empty
qpop succeeds qpop succeeds
% pushes up to test1b.patch and succeeds % pushes up to test1b.patch and succeeds
@ -213,6 +230,7 @@ abort: cannot push to a previous patch: test.patch
abort: patch test2.patch is not applied abort: patch test2.patch is not applied
qpop test2.patch fails qpop test2.patch fails
% pops up to test.patch and succeeds % pops up to test.patch and succeeds
popping test1b.patch
now at: test.patch now at: test.patch
qpop test.patch succeeds qpop test.patch succeeds
% pushes all patches and succeeds % pushes all patches and succeeds
@ -269,6 +287,8 @@ diff -r cb9a9f314b8b b/f
+f +f
M a M a
% qpush failure % qpush failure
popping bar
popping foo
patch queue now empty patch queue now empty
applying foo applying foo
applying bar applying bar
@ -284,6 +304,7 @@ errors during apply, please fix and refresh bar
1 qbase foo 1 qbase foo
2 qtip bar tip 2 qtip bar tip
% bad node in status % bad node in status
popping bar
now at: foo now at: foo
changeset: 0:cb9a9f314b8b changeset: 0:cb9a9f314b8b
mq status file refers to unknown node mq status file refers to unknown node
@ -308,6 +329,7 @@ copy file
diff --git a/new b/copy diff --git a/new b/copy
copy from new copy from new
copy to copy copy to copy
popping copy
now at: new now at: new
applying copy applying copy
now at: copy now at: copy
@ -320,6 +342,7 @@ copy to copy
1 files updated, 0 files merged, 2 files removed, 0 files unresolved 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
created new head created new head
2 files updated, 0 files merged, 1 files removed, 0 files unresolved 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
popping bar
adding branch adding branch
adding changesets adding changesets
adding manifests adding manifests
@ -354,6 +377,7 @@ diff --git a/foo b/baz
1 files updated, 0 files merged, 2 files removed, 0 files unresolved 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
2 files updated, 0 files merged, 1 files removed, 0 files unresolved 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
popping bar
adding branch adding branch
adding changesets adding changesets
adding manifests adding manifests
@ -386,6 +410,7 @@ new file mode 100644
% refresh omitting an added file % refresh omitting an added file
C newfile C newfile
A newfile A newfile
popping baz
now at: bar now at: bar
% create a git patch % create a git patch
diff --git a/alexander b/alexander diff --git a/alexander b/alexander
@ -393,6 +418,7 @@ diff --git a/alexander b/alexander
8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
diff --git a/bucephalus b/bucephalus diff --git a/bucephalus b/bucephalus
% check binary patches can be popped and pushed % check binary patches can be popped and pushed
popping addbucephalus
now at: addalexander now at: addalexander
applying addbucephalus applying addbucephalus
now at: addbucephalus now at: addbucephalus
@ -461,6 +487,7 @@ main repo:
rev 0: add foo rev 0: add foo
patch repo: patch repo:
rev 0: checkpoint rev 0: checkpoint
popping patch1
patch queue now empty patch queue now empty
main repo: main repo:
rev 0: add foo rev 0: add foo
@ -475,12 +502,14 @@ patch repo:
rev 0: checkpoint rev 0: checkpoint
% test applying on an empty file (issue 1033) % test applying on an empty file (issue 1033)
adding a adding a
popping changea
patch queue now empty patch queue now empty
applying changea applying changea
now at: changea now at: changea
% test qpush with --force, issue1087 % test qpush with --force, issue1087
adding bye.txt adding bye.txt
adding hello.txt adding hello.txt
popping empty
patch queue now empty patch queue now empty
% qpush should fail, local changes % qpush should fail, local changes
abort: local changes found, refresh first abort: local changes found, refresh first
@ -510,6 +539,7 @@ date: Thu Jan 01 00:00:00 1970 +0000
summary: imported patch empty summary: imported patch empty
popping empty
patch queue now empty patch queue now empty
% qpush should fail, local changes % qpush should fail, local changes
abort: local changes found, refresh first abort: local changes found, refresh first
@ -539,4 +569,5 @@ diff -r 9ecee4f634e3 hello.txt
% test popping revisions not in working dir ancestry % test popping revisions not in working dir ancestry
0 A empty 0 A empty
1 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
popping empty
patch queue now empty patch queue now empty

View File

@ -79,6 +79,8 @@ diff -r x -r y f
+mq1r1mq2 +mq1r1mq2
% Adding one git-style patch and one normal % Adding one git-style patch and one normal
popping f2.patch
popping f.patch
patch queue now empty patch queue now empty
1 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
% Git patch % Git patch