graft: show more useful status information while grafting
authorMads Kiilerich <madski@unity3d.com>
Tue, 09 Dec 2014 03:38:23 +0100
changeset 23505 bd5dbb8a05c8
parent 23504 e172a1f2b5bb
child 23506 dc82f1a7436d
graft: show more useful status information while grafting Show status messages with first line of commit description and names, like grafting 12:2647734878ef "fork" (tip) This gives more context for the user when resolving conflicts.
mercurial/commands.py
tests/test-commit-amend.t
tests/test-graft.t
tests/test-hgweb-commands.t
tests/test-rebase-obsolete.t
--- a/mercurial/commands.py	Tue Dec 09 03:37:55 2014 +0100
+++ b/mercurial/commands.py	Tue Dec 09 03:38:23 2014 +0100
@@ -3446,8 +3446,12 @@
     wlock = repo.wlock()
     try:
         for pos, ctx in enumerate(repo.set("%ld", revs)):
-
-            ui.status(_('grafting revision %s\n') % ctx.rev())
+            desc = '%d:%s "%s"' % (ctx.rev(), ctx,
+                                   ctx.description().split('\n', 1)[0])
+            names = repo.nodetags(ctx.node()) + repo.nodebookmarks(ctx.node())
+            if names:
+                desc += ' (%s)' % ' '.join(names)
+            ui.status(_('grafting %s\n') % desc)
             if opts.get('dry_run'):
                 continue
 
--- a/tests/test-commit-amend.t	Tue Dec 09 03:37:55 2014 +0100
+++ b/tests/test-commit-amend.t	Tue Dec 09 03:38:23 2014 +0100
@@ -447,7 +447,7 @@
   $ hg up 11
   5 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg graft 12
-  grafting revision 12
+  grafting 12:2647734878ef "fork" (tip)
   $ hg ci --amend -m 'graft amend'
   saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-amend-backup.hg (glob)
   $ hg log -r . --debug | grep extra
--- a/tests/test-graft.t	Tue Dec 09 03:37:55 2014 +0100
+++ b/tests/test-graft.t	Tue Dec 09 03:38:23 2014 +0100
@@ -82,7 +82,7 @@
   A b
   R a
   $ HGEDITOR=cat hg graft 2 -u foo --edit
-  grafting revision 2
+  grafting 2:5c095ad7e90f "2"
   merging a and b to b
   2
   
@@ -133,16 +133,16 @@
   $ hg graft 1 5 4 3 'merge()' 2 -n
   skipping ungraftable merge revision 6
   skipping revision 2 (already grafted to 7)
-  grafting revision 1
-  grafting revision 5
-  grafting revision 4
-  grafting revision 3
+  grafting 1:5d205f8b35b6 "1"
+  grafting 5:97f8bfe72746 "5"
+  grafting 4:9c233e8e184d "4"
+  grafting 3:4c60f11aa304 "3"
 
   $ HGEDITOR=cat hg graft 1 5 4 3 'merge()' 2 --debug
   skipping ungraftable merge revision 6
   scanning for duplicate grafts
   skipping revision 2 (already grafted to 7)
-  grafting revision 1
+  grafting 1:5d205f8b35b6 "1"
     searching for copies back to rev 1
     unmatched files in local:
      b
@@ -160,7 +160,7 @@
   my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
    premerge successful
   b
-  grafting revision 5
+  grafting 5:97f8bfe72746 "5"
     searching for copies back to rev 1
   resolving manifests
    branchmerge: True, force: True, partial: False
@@ -170,7 +170,7 @@
   updating: e 1/1 files (100.00%)
    b: remote unchanged -> k
   e
-  grafting revision 4
+  grafting 4:9c233e8e184d "4"
     searching for copies back to rev 1
   resolving manifests
    branchmerge: True, force: True, partial: False
@@ -216,7 +216,7 @@
   skipping revision 2 (already grafted to 7)
   skipping revision 1 (already grafted to 8)
   skipping revision 5 (already grafted to 9)
-  grafting revision 4
+  grafting 4:9c233e8e184d "4"
   merging e
   warning: conflicts during merge.
   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
@@ -227,7 +227,7 @@
 Continue without resolve should fail:
 
   $ hg graft -c
-  grafting revision 4
+  grafting 4:9c233e8e184d "4"
   abort: unresolved merge conflicts (see hg help resolve)
   [255]
 
@@ -250,8 +250,8 @@
 Continue for real, clobber usernames
 
   $ hg graft -c -U
-  grafting revision 4
-  grafting revision 3
+  grafting 4:9c233e8e184d "4"
+  grafting 3:4c60f11aa304 "3"
 
 Compare with original:
 
@@ -299,7 +299,7 @@
   $ hg ci -m 7
   created new head
   $ hg graft 7
-  grafting revision 7
+  grafting 7:ef0ef43d49e7 "2"
 
   $ hg log -r 7 --template '{rev}:{node}\n'
   7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
@@ -350,7 +350,7 @@
 
   $ hg up -Cq 1
   $ hg graft 3 --log -u foo
-  grafting revision 3
+  grafting 3:4c60f11aa304 "3"
   warning: can't find ancestor for 'c' copied from 'b'!
   $ hg log --template '{rev} {parents} {desc}\n' -r tip
   14 1:5d205f8b35b6  3
@@ -364,7 +364,7 @@
   $ echo c > a
   $ hg ci -m 9
   $ hg graft 1 --tool internal:fail
-  grafting revision 1
+  grafting 1:5d205f8b35b6 "1"
   abort: unresolved conflicts, can't continue
   (use hg resolve and hg graft --continue)
   [255]
@@ -383,7 +383,7 @@
   $ hg resolve -m a
   (no more unresolved files)
   $ hg graft -c
-  grafting revision 1
+  grafting 1:5d205f8b35b6 "1"
   $ hg export tip --git
   # HG changeset patch
   # User bar
@@ -404,7 +404,7 @@
   $ echo c > a
   $ hg ci -m 10
   $ hg graft 2 --tool internal:fail
-  grafting revision 2
+  grafting 2:5c095ad7e90f "2"
   abort: unresolved conflicts, can't continue
   (use hg resolve and hg graft --continue)
   [255]
@@ -412,7 +412,7 @@
   merging a and b to b
   (no more unresolved files)
   $ hg graft -c
-  grafting revision 2
+  grafting 2:5c095ad7e90f "2"
   $ hg export tip --git
   # HG changeset patch
   # User test
@@ -644,9 +644,9 @@
   skipping ancestor revision 21
   skipping ancestor revision 22
   skipping revision 2 (already grafted to 22)
-  grafting revision 7
-  grafting revision 13
-  grafting revision 19
+  grafting 7:ef0ef43d49e7 "2"
+  grafting 13:9db0f28fd374 "2"
+  grafting 19:9627f653b421 "2"
   merging b
 
 graft with --force (still doesn't graft merges)
@@ -658,9 +658,9 @@
   [255]
   $ hg graft 19 0 6 --force
   skipping ungraftable merge revision 6
-  grafting revision 19
+  grafting 19:9627f653b421 "2"
   merging b
-  grafting revision 0
+  grafting 0:68795b066622 "0"
 
 graft --force after backout
 
@@ -673,7 +673,7 @@
   skipping ancestor revision 28
   [255]
   $ hg graft 28 --force
-  grafting revision 28
+  grafting 28:6c56f0f7f033 "28"
   merging a
   $ cat a
   abc
@@ -683,7 +683,7 @@
   $ echo def > a
   $ hg ci -m 31
   $ hg graft 28 --force --tool internal:fail
-  grafting revision 28
+  grafting 28:6c56f0f7f033 "28"
   abort: unresolved conflicts, can't continue
   (use hg resolve and hg graft --continue)
   [255]
@@ -696,7 +696,7 @@
   $ hg resolve -m a
   (no more unresolved files)
   $ hg graft -c
-  grafting revision 28
+  grafting 28:6c56f0f7f033 "28"
   $ cat a
   abc
 
--- a/tests/test-hgweb-commands.t	Tue Dec 09 03:37:55 2014 +0100
+++ b/tests/test-hgweb-commands.t	Tue Dec 09 03:38:23 2014 +0100
@@ -2201,12 +2201,12 @@
   $ hg ci -m 'Babar is in the jungle!'
   created new head
   $ hg graft 0::
-  grafting revision 0
-  grafting revision 1
-  grafting revision 2
-  grafting revision 3
-  grafting revision 4
-  grafting revision 5
+  grafting 0:b4e73ffab476 "0"
+  grafting 1:e06180cbfb0c "1"
+  grafting 2:ab4f1438558b "2"
+  grafting 3:ada793dcc118 "3"
+  grafting 4:b60a39a85a01 "4" (secret)
+  grafting 5:aed2d9c1d0e7 "5"
 (turning the initial root secret (filtered))
   $ hg phase --force --secret 0
   $ PATH_INFO=/graph/; export PATH_INFO
--- a/tests/test-rebase-obsolete.t	Tue Dec 09 03:37:55 2014 +0100
+++ b/tests/test-rebase-obsolete.t	Tue Dec 09 03:38:23 2014 +0100
@@ -118,8 +118,8 @@
 set.
 
   $ hg graft 42ccdea3bb16 32af7686d403
-  grafting revision 1
-  grafting revision 3
+  grafting 1:42ccdea3bb16 "B"
+  grafting 3:32af7686d403 "D"
   $ hg rebase  -s 42ccdea3bb16 -d .
   $ hg log -G
   o  10:5ae4c968c6ac C