mercurial/crew

changeset 9110:561ff8d9e4f0

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.
author Mads Kiilerich <mads@kiilerich.com>
date Thu Jul 09 23:59:03 2009 +0200 (7 months ago)
parents 00909238d887
children ac3f1e6696eb
files hgext/mq.py tests/test-keyword.out tests/test-mq-caches.out tests/test-mq-eol.out tests/test-mq-guards.out tests/test-mq-header-date.out tests/test-mq-header-from.out tests/test-mq-merge.out tests/test-mq-missingfiles.out tests/test-mq-pull-from-bundle.out tests/test-mq-qdelete.out tests/test-mq-qdiff.out tests/test-mq-qfold.out tests/test-mq-qgoto.out tests/test-mq-qimport.out tests/test-mq-qnew.out tests/test-mq-qpush-fail.out tests/test-mq-symlinks.out tests/test-mq.out tests/test-rebase-mq.out
line diff
     1.1 --- a/hgext/mq.py
     1.2 +++ b/hgext/mq.py
     1.3 @@ -1080,6 +1080,8 @@
     1.4                      except: pass
     1.5                      repo.dirstate.forget(f)
     1.6                  repo.dirstate.setparents(qp, nullid)
     1.7 +            for patch in reversed(self.applied[start:end]):
     1.8 +                self.ui.warn(_("popping %s\n") % patch.name)
     1.9              del self.applied[start:end]
    1.10              self.strip(repo, rev, update=False, backup='strip')
    1.11              if len(self.applied):
     2.1 --- a/tests/test-keyword.out
     2.2 +++ b/tests/test-keyword.out
     2.3 @@ -210,6 +210,7 @@
     2.4  +$Id$
     2.5  +tests for different changenodes
     2.6  % qpop
     2.7 +popping mqtest.diff
     2.8  patch queue now empty
     2.9  % qgoto - should imply qpush
    2.10  applying mqtest.diff
    2.11 @@ -218,6 +219,7 @@
    2.12  $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
    2.13  tests for different changenodes
    2.14  % qpop and move on
    2.15 +popping mqtest.diff
    2.16  patch queue now empty
    2.17  % copy
    2.18  % kwfiles added
     3.1 --- a/tests/test-mq-caches.out
     3.2 +++ b/tests/test-mq-caches.out
     3.3 @@ -5,6 +5,7 @@
     3.4  No branch cache
     3.5  
     3.6  # some regular revisions
     3.7 +popping p1
     3.8  patch queue now empty
     3.9  tip: 1
    3.10  3f910abad313ff802d3a23a7529433872df9b3ae 1
    3.11 @@ -43,6 +44,9 @@
    3.12  qbase: 1
    3.13  
    3.14  # detect an invalid cache
    3.15 +popping p2
    3.16 +popping p1
    3.17 +popping p0
    3.18  patch queue now empty
    3.19  applying p0
    3.20  applying p1
     4.1 --- a/tests/test-mq-eol.out
     4.2 +++ b/tests/test-mq-eol.out
     4.3 @@ -9,12 +9,14 @@
     4.4  patch failed, unable to continue (try -v)
     4.5  patch failed, rejects left in working dir
     4.6  errors during apply, please fix and refresh eol.diff
     4.7 +popping eol.diff
     4.8  patch queue now empty
     4.9  % invalid eol
    4.10  applying eol.diff
    4.11  patch failed, unable to continue (try -v)
    4.12  patch failed, rejects left in working dir
    4.13  errors during apply, please fix and refresh eol.diff
    4.14 +popping eol.diff
    4.15  patch queue now empty
    4.16  % force LF
    4.17  applying eol.diff
    4.18 @@ -42,6 +44,7 @@
    4.19  c<CR><LF>
    4.20  d<CR><LF>
    4.21  z
    4.22 +popping eol.diff
    4.23  patch queue now empty
    4.24  % push again forcing LF and compare revisions
    4.25  applying eol.diff
    4.26 @@ -51,6 +54,7 @@
    4.27  c<CR><LF>
    4.28  d<CR><LF>
    4.29  z
    4.30 +popping eol.diff
    4.31  patch queue now empty
    4.32  % push again without LF and compare revisions
    4.33  applying eol.diff
    4.34 @@ -60,4 +64,5 @@
    4.35  c<CR><LF>
    4.36  d<CR><LF>
    4.37  z
    4.38 +popping eol.diff
    4.39  patch queue now empty
     5.1 --- a/tests/test-mq-guards.out
     5.2 +++ b/tests/test-mq-guards.out
     5.3 @@ -1,4 +1,7 @@
     5.4  adding x
     5.5 +popping c.patch
     5.6 +popping b.patch
     5.7 +popping a.patch
     5.8  patch queue now empty
     5.9  % should fail
    5.10  abort: no patch named does-not-exist.patch
    5.11 @@ -9,6 +12,7 @@
    5.12  % should guard a.patch
    5.13  % should print +a
    5.14  a.patch: +a
    5.15 +popping a.patch
    5.16  patch queue now empty
    5.17  % should fail
    5.18  cannot push 'a.patch' - guarded by ['+a']
    5.19 @@ -16,6 +20,7 @@
    5.20  % should push b.patch
    5.21  applying b.patch
    5.22  now at: b.patch
    5.23 +popping b.patch
    5.24  patch queue now empty
    5.25  % test selection of an empty guard
    5.26  abort: guard cannot be an empty string
    5.27 @@ -34,6 +39,9 @@
    5.28  % should push c.patch
    5.29  applying c.patch
    5.30  now at: c.patch
    5.31 +popping c.patch
    5.32 +popping b.patch
    5.33 +popping a.patch
    5.34  patch queue now empty
    5.35  guards deactivated
    5.36  number of unguarded, unapplied patches has changed from 3 to 2
    5.37 @@ -41,6 +49,8 @@
    5.38  applying b.patch
    5.39  applying c.patch
    5.40  now at: c.patch
    5.41 +popping c.patch
    5.42 +popping b.patch
    5.43  patch queue now empty
    5.44  number of unguarded, unapplied patches has changed from 1 to 2
    5.45  % should push a.patch, not b.patch
    5.46 @@ -48,6 +58,8 @@
    5.47  now at: a.patch
    5.48  applying c.patch
    5.49  now at: c.patch
    5.50 +popping c.patch
    5.51 +popping a.patch
    5.52  patch queue now empty
    5.53  % should push b.patch
    5.54  applying b.patch
    5.55 @@ -55,6 +67,8 @@
    5.56  applying c.patch
    5.57  now at: c.patch
    5.58  c.patch
    5.59 +popping c.patch
    5.60 +popping b.patch
    5.61  patch queue now empty
    5.62  number of unguarded, unapplied patches has changed from 2 to 3
    5.63  % should push a.patch, b.patch
    5.64 @@ -62,6 +76,8 @@
    5.65  now at: a.patch
    5.66  applying b.patch
    5.67  now at: b.patch
    5.68 +popping b.patch
    5.69 +popping a.patch
    5.70  patch queue now empty
    5.71  number of unguarded, unapplied patches has changed from 3 to 2
    5.72  % list patches and guards
    5.73 @@ -83,6 +99,8 @@
    5.74  now at: c.patch
    5.75  guards deactivated
    5.76  popping guarded patches
    5.77 +popping c.patch
    5.78 +popping b.patch
    5.79  patch queue now empty
    5.80  reapplying unguarded patches
    5.81  applying c.patch
    5.82 @@ -100,6 +118,7 @@
    5.83  new.patch: +1 +2 -3
    5.84  b.patch: +2
    5.85  c.patch: unguarded
    5.86 +popping d.patch
    5.87  now at: c.patch
    5.88  % should show new.patch and b.patch as Guarded, c.patch as Applied
    5.89  % and d.patch as Unapplied
    5.90 @@ -112,6 +131,7 @@
    5.91  1 G b.patch
    5.92  2 A c.patch
    5.93  3 G d.patch
    5.94 +popping c.patch
    5.95  patch queue now empty
    5.96  new.patch: +1 +2 -3
    5.97  b.patch: +2
     6.1 --- a/tests/test-mq-header-date.out
     6.2 +++ b/tests/test-mq-header-date.out
     6.3 @@ -42,6 +42,7 @@
     6.4  +2
     6.5  1: [mq]: 2.patch - test
     6.6  0: [mq]: 1.patch - test
     6.7 +popping 2.patch
     6.8  now at: 1.patch
     6.9  ==== qnew -d -m
    6.10  # HG changeset patch
    6.11 @@ -127,8 +128,10 @@
    6.12  2: Four - test
    6.13  1: Three (again) - test
    6.14  0: [mq]: 1.patch - test
    6.15 +popping 4.patch
    6.16  now at: 3.patch
    6.17  ==== qnew with HG header
    6.18 +popping 5.patch
    6.19  now at: 3.patch
    6.20  # HG changeset patch
    6.21  # Date 10 0
    6.22 @@ -185,6 +188,7 @@
    6.23  2: [mq]: 5.patch - test
    6.24  1: Three (again) - test
    6.25  0: [mq]: 1.patch - test
    6.26 +popping 6.patch
    6.27  now at: 5.patch
    6.28  ==== qnew -d
    6.29  adding 7
    6.30 @@ -240,6 +244,7 @@
    6.31  2: [mq]: 5.patch - test
    6.32  1: Three (again) - test
    6.33  0: [mq]: 1.patch - test
    6.34 +popping 8.patch
    6.35  now at: 7.patch
    6.36  ==== qnew -m
    6.37  adding 9
    6.38 @@ -270,8 +275,13 @@
    6.39  2: [mq]: 5.patch - test
    6.40  1: Three (again) - test
    6.41  0: [mq]: 1.patch - test
    6.42 +popping 9.patch
    6.43  now at: 7.patch
    6.44  ==== qpop -a / qpush -a
    6.45 +popping 7.patch
    6.46 +popping 5.patch
    6.47 +popping 3.patch
    6.48 +popping 1.patch
    6.49  patch queue now empty
    6.50  applying 1.patch
    6.51  applying 3.patch
     7.1 --- a/tests/test-mq-header-from.out
     7.2 +++ b/tests/test-mq-header-from.out
     7.3 @@ -131,6 +131,7 @@
     7.4  1: [mq]: 2.patch - jane
     7.5  0: [mq]: 1.patch - mary
     7.6  ==== qnew with HG header
     7.7 +popping 5.patch
     7.8  now at: 4.patch
     7.9  now at: 5.patch
    7.10  # HG changeset patch
    7.11 @@ -184,6 +185,11 @@
    7.12  1: [mq]: 2.patch - jane
    7.13  0: [mq]: 1.patch - mary
    7.14  ==== qpop -a / qpush -a
    7.15 +popping 5.patch
    7.16 +popping 4.patch
    7.17 +popping 3.patch
    7.18 +popping 2.patch
    7.19 +popping 1.patch
    7.20  patch queue now empty
    7.21  applying 1.patch
    7.22  applying 2.patch
     8.1 --- a/tests/test-mq-merge.out
     8.2 +++ b/tests/test-mq-merge.out
     8.3 @@ -10,6 +10,8 @@
     8.4  applying rm_a
     8.5  now at: rm_a
     8.6  b
     8.7 +popping rm_a
     8.8 +popping .hg.patches.merge.marker
     8.9  patch queue now empty
    8.10  
    8.11  % init t2
     9.1 --- a/tests/test-mq-missingfiles.out
     9.2 +++ b/tests/test-mq-missingfiles.out
     9.3 @@ -1,4 +1,5 @@
     9.4  adding b
     9.5 +popping changeb
     9.6  patch queue now empty
     9.7  % push patch with missing target
     9.8  applying changeb
     9.9 @@ -26,6 +27,7 @@
    9.10  +c
    9.11  +c
    9.12  adding b
    9.13 +popping changeb
    9.14  patch queue now empty
    9.15  % push git patch with missing target
    9.16  applying changeb
    9.17 @@ -48,6 +50,7 @@
    9.18  
    9.19  % test push creating directory during git copy or rename
    9.20  adding a
    9.21 +popping patch
    9.22  patch queue now empty
    9.23  applying patch
    9.24  now at: patch
    10.1 --- a/tests/test-mq-pull-from-bundle.out
    10.2 +++ b/tests/test-mq-pull-from-bundle.out
    10.3 @@ -13,6 +13,7 @@
    10.4  1: main: one updated.
    10.5  ====== Setup queue
    10.6  adding two
    10.7 +popping two.patch
    10.8  patch queue now empty
    10.9  ====== Bundle queue
   10.10  1 changesets found
    11.1 --- a/tests/test-mq-qdelete.out
    11.2 +++ b/tests/test-mq-qdelete.out
    11.3 @@ -1,6 +1,7 @@
    11.4  adding base
    11.5  abort: qdelete requires at least one revision or patch name
    11.6  abort: cannot delete applied patch c
    11.7 +popping c
    11.8  now at: b
    11.9  a
   11.10  b
   11.11 @@ -8,6 +9,7 @@
   11.12  b
   11.13  series
   11.14  status
   11.15 +popping b
   11.16  now at: a
   11.17  a
   11.18  b
   11.19 @@ -30,6 +32,7 @@
   11.20  no patches applied
   11.21  abort: revision 0 is not managed
   11.22  abort: cannot delete revision 2 above applied patches
   11.23 +popping c
   11.24  now at: b
   11.25  abort: unknown revision 'c'!
   11.26  applying c
    12.1 --- a/tests/test-mq-qdiff.out
    12.2 +++ b/tests/test-mq-qdiff.out
    12.3 @@ -26,6 +26,7 @@
    12.4  +patched
    12.5  % revert
    12.6  % qpop
    12.7 +popping mqbase
    12.8  patch queue now empty
    12.9  % qdelete mqbase
   12.10  % commit 2
    13.1 --- a/tests/test-mq-qfold.out
    13.2 +++ b/tests/test-mq-qfold.out
    13.3 @@ -1,6 +1,8 @@
    13.4  % init
    13.5  adding a
    13.6  % fold in the middle of the queue
    13.7 +popping p3
    13.8 +popping p2
    13.9  now at: p1
   13.10  --- a/a
   13.11  +++ b/a
    14.1 --- a/tests/test-mq-qgoto.out
    14.2 +++ b/tests/test-mq-qgoto.out
    14.3 @@ -1,17 +1,24 @@
    14.4  adding a
    14.5 +popping c.patch
    14.6 +popping b.patch
    14.7  now at: a.patch
    14.8  applying b.patch
    14.9  applying c.patch
   14.10  now at: c.patch
   14.11 +popping c.patch
   14.12  now at: b.patch
   14.13  
   14.14  % Using index
   14.15 +popping b.patch
   14.16  now at: a.patch
   14.17  applying b.patch
   14.18  applying c.patch
   14.19  now at: c.patch
   14.20  
   14.21  % No warnings when using index
   14.22 +popping bug141421
   14.23 +popping bug314159
   14.24 +popping c.patch
   14.25  now at: b.patch
   14.26  applying c.patch
   14.27  applying bug314159
    15.1 --- a/tests/test-mq-qimport.out
    15.2 +++ b/tests/test-mq-qimport.out
    15.3 @@ -8,12 +8,14 @@
    15.4  applying url.diff
    15.5  now at: url.diff
    15.6  foo
    15.7 +popping url.diff
    15.8  patch queue now empty
    15.9  % qimport -f
   15.10  adding url.diff to series file
   15.11  applying url.diff
   15.12  now at: url.diff
   15.13  foo2
   15.14 +popping url.diff
   15.15  patch queue now empty
   15.16  % build diff with CRLF
   15.17  adding b
    16.1 --- a/tests/test-mq-qnew.out
    16.2 +++ b/tests/test-mq-qnew.out
    16.3 @@ -20,6 +20,9 @@
    16.4  abort: patch "first.patch" already exists
    16.5  abort: patch "first.patch" already exists
    16.6  % qnew -f from a subdirectory
    16.7 +popping first.patch
    16.8 +popping mtest.patch
    16.9 +popping test.patch
   16.10  patch queue now empty
   16.11  adding d/b
   16.12  M d/b
    17.1 --- a/tests/test-mq-qpush-fail.out
    17.2 +++ b/tests/test-mq-qpush-fail.out
    17.3 @@ -1,6 +1,9 @@
    17.4  adding foo
    17.5  % test qpush on empty series
    17.6  no patches in series
    17.7 +popping bad-patch
    17.8 +popping patch2
    17.9 +popping patch1
   17.10  patch queue now empty
   17.11  applying patch1
   17.12  applying patch2
    18.1 --- a/tests/test-mq-symlinks.out
    18.2 +++ b/tests/test-mq-symlinks.out
    18.3 @@ -1,9 +1,11 @@
    18.4  a -> a not a symlink
    18.5  a -> b
    18.6 +popping symlink.patch
    18.7  now at: base.patch
    18.8  applying symlink.patch
    18.9  now at: symlink.patch
   18.10  a -> b
   18.11 +popping removesl.patch
   18.12  now at: symlink.patch
   18.13  applying removesl.patch
   18.14  now at: removesl.patch
    19.1 --- a/tests/test-mq.out
    19.2 +++ b/tests/test-mq.out
    19.3 @@ -108,16 +108,20 @@
    19.4   a
    19.5  +a
    19.6  % qpop
    19.7 +popping test.patch
    19.8  patch queue now empty
    19.9  % qpush
   19.10  applying test.patch
   19.11  now at: test.patch
   19.12  % pop/push outside repo
   19.13 +popping test.patch
   19.14  patch queue now empty
   19.15  applying test.patch
   19.16  now at: test.patch
   19.17  % qrefresh in subdir
   19.18  % pop/push -a in subdir
   19.19 +popping test2.patch
   19.20 +popping test.patch
   19.21  patch queue now empty
   19.22  applying test.patch
   19.23  applying test2.patch
   19.24 @@ -125,6 +129,7 @@
   19.25  % qseries
   19.26  test.patch
   19.27  test2.patch
   19.28 +popping test2.patch
   19.29  now at: test.patch
   19.30  0 A test.patch: foo bar
   19.31  1 U test2.patch: 
   19.32 @@ -140,6 +145,7 @@
   19.33  % qnext
   19.34  all patches applied
   19.35  % pop, qnext, qprev, qapplied
   19.36 +popping test2.patch
   19.37  now at: test.patch
   19.38  test2.patch
   19.39  only one patch applied
   19.40 @@ -156,17 +162,24 @@
   19.41  % qpush/qpop with index
   19.42  applying test2.patch
   19.43  now at: test2.patch
   19.44 +popping test2.patch
   19.45 +popping test1b.patch
   19.46  now at: test.patch
   19.47  applying test1b.patch
   19.48  now at: test1b.patch
   19.49  applying test2.patch
   19.50  now at: test2.patch
   19.51 +popping test2.patch
   19.52  now at: test1b.patch
   19.53 +popping test1b.patch
   19.54  now at: test.patch
   19.55  applying test1b.patch
   19.56  applying test2.patch
   19.57  now at: test2.patch
   19.58  % push should succeed
   19.59 +popping test2.patch
   19.60 +popping test1b.patch
   19.61 +popping test.patch
   19.62  patch queue now empty
   19.63  pushing to ../../k
   19.64  searching for changes
   19.65 @@ -180,6 +193,9 @@
   19.66  applying test2.patch
   19.67  now at: test2.patch
   19.68    % pops all patches and succeeds
   19.69 +popping test2.patch
   19.70 +popping test1b.patch
   19.71 +popping test.patch
   19.72  patch queue now empty
   19.73    qpop -a succeeds
   19.74    % does nothing and succeeds
   19.75 @@ -193,6 +209,7 @@
   19.76  now at: test.patch
   19.77    qpush succeeds
   19.78    % pops a patch and succeeds
   19.79 +popping test.patch
   19.80  patch queue now empty
   19.81    qpop succeeds
   19.82    % pushes up to test1b.patch and succeeds
   19.83 @@ -213,6 +230,7 @@
   19.84  abort: patch test2.patch is not applied
   19.85    qpop test2.patch fails
   19.86    % pops up to test.patch and succeeds
   19.87 +popping test1b.patch
   19.88  now at: test.patch
   19.89    qpop test.patch succeeds
   19.90    % pushes all patches and succeeds
   19.91 @@ -269,6 +287,8 @@
   19.92  +f
   19.93  M a
   19.94  % qpush failure
   19.95 +popping bar
   19.96 +popping foo
   19.97  patch queue now empty
   19.98  applying foo
   19.99  applying bar
  19.100 @@ -284,6 +304,7 @@
  19.101  1 qbase foo
  19.102  2 qtip bar tip
  19.103  % bad node in status
  19.104 +popping bar
  19.105  now at: foo
  19.106  changeset:   0:cb9a9f314b8b
  19.107  mq status file refers to unknown node
  19.108 @@ -308,6 +329,7 @@
  19.109  diff --git a/new b/copy
  19.110  copy from new
  19.111  copy to copy
  19.112 +popping copy
  19.113  now at: new
  19.114  applying copy
  19.115  now at: copy
  19.116 @@ -320,6 +342,7 @@
  19.117  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
  19.118  created new head
  19.119  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
  19.120 +popping bar
  19.121  adding branch
  19.122  adding changesets
  19.123  adding manifests
  19.124 @@ -354,6 +377,7 @@
  19.125  
  19.126  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
  19.127  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
  19.128 +popping bar
  19.129  adding branch
  19.130  adding changesets
  19.131  adding manifests
  19.132 @@ -386,6 +410,7 @@
  19.133  % refresh omitting an added file
  19.134  C newfile
  19.135  A newfile
  19.136 +popping baz
  19.137  now at: bar
  19.138  % create a git patch
  19.139  diff --git a/alexander b/alexander
  19.140 @@ -393,6 +418,7 @@
  19.141  8ba2a2f3e77b55d03051ff9c24ad65e7  bucephalus
  19.142  diff --git a/bucephalus b/bucephalus
  19.143  % check binary patches can be popped and pushed
  19.144 +popping addbucephalus
  19.145  now at: addalexander
  19.146  applying addbucephalus
  19.147  now at: addbucephalus
  19.148 @@ -461,6 +487,7 @@
  19.149      rev 0: add foo
  19.150  patch repo:
  19.151      rev 0: checkpoint
  19.152 +popping patch1
  19.153  patch queue now empty
  19.154  main repo:
  19.155      rev 0: add foo
  19.156 @@ -475,12 +502,14 @@
  19.157      rev 0: checkpoint
  19.158  % test applying on an empty file (issue 1033)
  19.159  adding a
  19.160 +popping changea
  19.161  patch queue now empty
  19.162  applying changea
  19.163  now at: changea
  19.164  % test qpush with --force, issue1087
  19.165  adding bye.txt
  19.166  adding hello.txt
  19.167 +popping empty
  19.168  patch queue now empty
  19.169  % qpush should fail, local changes
  19.170  abort: local changes found, refresh first
  19.171 @@ -510,6 +539,7 @@
  19.172  summary:     imported patch empty
  19.173  
  19.174  
  19.175 +popping empty
  19.176  patch queue now empty
  19.177  % qpush should fail, local changes
  19.178  abort: local changes found, refresh first
  19.179 @@ -539,4 +569,5 @@
  19.180  % test popping revisions not in working dir ancestry
  19.181  0 A empty
  19.182  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  19.183 +popping empty
  19.184  patch queue now empty
    20.1 --- a/tests/test-rebase-mq.out
    20.2 +++ b/tests/test-rebase-mq.out
    20.3 @@ -79,6 +79,8 @@
    20.4  +mq1r1mq2
    20.5  
    20.6  % Adding one git-style patch and one normal
    20.7 +popping f2.patch
    20.8 +popping f.patch
    20.9  patch queue now empty
   20.10  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   20.11  % Git patch

Contact: Thomas Arendsen Hein <hg@intevation.org> - Intevation GmbH