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
repo.dirstate.forget(f)
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]
self.strip(repo, rev, update=False, backup='strip')
if len(self.applied):

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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