changeset 32698:1b5c61d38a52

update: show the commit to which we updated in case of multiple heads (BC) Currently when we have multiple heads on the same branch, update tells us that there some more heads for the current branch but does not tells us the head to which the repository has been updated to. It makes more sense showing the head we updated to and then telling there are some more heads.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 06 Jun 2017 22:17:39 +0530
parents 19b9fc40cc51
children f75d0aa5dc83
files mercurial/destutil.py tests/test-bisect2.t tests/test-blackbox.t tests/test-conflict.t tests/test-largefiles-cache.t tests/test-largefiles-update.t tests/test-merge-changedelete.t tests/test-merge-default.t tests/test-merge-types.t tests/test-pull-branch.t tests/test-pull-update.t tests/test-rebase-pull.t tests/test-strip.t tests/test-subrepo.t tests/test-transplant.t tests/test-up-local-change.t tests/test-update-branches.t
diffstat 17 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/destutil.py	Fri May 19 20:29:11 2017 -0700
+++ b/mercurial/destutil.py	Tue Jun 06 22:17:39 2017 +0530
@@ -391,6 +391,9 @@
                 ui.warn(_('(committing will reopen branch "%s")\n') %
                           (currentbranch))
         elif otherheads:
+            curhead = repo['.']
+            ui.status(_('updated to "%s: %s"\n') % (curhead,
+                                    curhead.description().split('\n')[0]))
             ui.status(_('%i other heads for branch "%s"\n') %
                       (len(otherheads), currentbranch))
 
--- a/tests/test-bisect2.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-bisect2.t	Tue Jun 06 22:17:39 2017 +0530
@@ -244,6 +244,7 @@
 
   $ hg up -C
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "d42e18c7bc9b: 18"
   3 other heads for branch "default"
 
 complex bisect test 1  # first bad rev is 9
--- a/tests/test-blackbox.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-blackbox.t	Tue Jun 06 22:17:39 2017 +0530
@@ -137,6 +137,7 @@
   $ hg update
   hooked
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "d02f48003e62: c"
   1 other heads for branch "default"
   $ hg blackbox -l 6
   1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update
--- a/tests/test-conflict.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-conflict.t	Tue Jun 06 22:17:39 2017 +0530
@@ -220,6 +220,7 @@
 
   $ hg up -C
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "e0693e20f496: 123456789012345678901234567890123456789012345678901234567890????"
   1 other heads for branch "default"
   $ printf "\n\nEnd of file\n" >> a
   $ hg ci -m "Add some stuff at the end"
@@ -258,6 +259,7 @@
 
   $ hg up -C
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to "18b51d585961: Add some stuff at the beginning"
   1 other heads for branch "default"
   $ hg merge --tool :merge-local
   merging a
--- a/tests/test-largefiles-cache.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-largefiles-cache.t	Tue Jun 06 22:17:39 2017 +0530
@@ -206,6 +206,7 @@
   large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 (glob)
   0 largefiles updated, 0 removed
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "cd24c147f45c: modified"
   [12] other heads for branch "default" (re)
   $ hg st
   ! large
--- a/tests/test-largefiles-update.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-largefiles-update.t	Tue Jun 06 22:17:39 2017 +0530
@@ -71,6 +71,7 @@
 
   $ hg up
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "f74e50bd9e55: #2"
   1 other heads for branch "default"
   $ hg debugdirstate --large --nodate
   n 644          7 set                 large1
@@ -86,6 +87,7 @@
   n 644         13 set                 large2
   $ hg up
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "f74e50bd9e55: #2"
   1 other heads for branch "default"
   $ hg debugdirstate --large --nodate
   n 644          7 set                 large1
@@ -471,6 +473,7 @@
   keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
   take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
   2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  updated to "d65e59e952a9: #5"
   1 other heads for branch "default"
 
   $ hg status -A large1
@@ -505,6 +508,7 @@
   keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
   take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
   2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  updated to "d65e59e952a9: #5"
   1 other heads for branch "default"
 
   $ hg status -A large1
--- a/tests/test-merge-changedelete.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-merge-changedelete.t	Tue Jun 06 22:17:39 2017 +0530
@@ -114,6 +114,7 @@
 
   $ hg co -C
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --config ui.interactive=true <<EOF
@@ -178,6 +179,7 @@
 
   $ hg co -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --config ui.interactive=true <<EOF
@@ -254,6 +256,7 @@
 
   $ hg co -C
   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --config ui.interactive=true <<EOF
@@ -316,6 +319,7 @@
 
   $ hg co -C
   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --tool :local
@@ -364,6 +368,7 @@
 
   $ hg co -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --tool :other
@@ -412,6 +417,7 @@
 
   $ hg co -C
   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --tool :fail
@@ -463,6 +469,7 @@
 
   $ hg co -C
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --config ui.interactive=True --tool :prompt
@@ -521,6 +528,7 @@
 
   $ hg co -C
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --tool :prompt
@@ -577,6 +585,7 @@
 
   $ hg co -C
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to "13910f48cf7b: changed file1, removed file2, changed file3"
   1 other heads for branch "default"
 
   $ hg merge --tool :merge3
--- a/tests/test-merge-default.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-merge-default.t	Tue Jun 06 22:17:39 2017 +0530
@@ -33,6 +33,7 @@
 
   $ hg up
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "f25cbe84d8b3: e"
   2 other heads for branch "default"
 
 Should fail because > 2 heads:
--- a/tests/test-merge-types.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-merge-types.t	Tue Jun 06 22:17:39 2017 +0530
@@ -155,6 +155,7 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg up
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "521a1e40188f: symlink"
   1 other heads for branch "default"
   $ hg st
   ? a.orig
@@ -176,6 +177,7 @@
   keep (l)ocal [working copy], take (o)ther [destination], or leave (u)nresolved for a? u
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges
+  updated to "521a1e40188f: symlink"
   1 other heads for branch "default"
   [1]
   $ hg diff --git
--- a/tests/test-pull-branch.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-pull-branch.t	Tue Jun 06 22:17:39 2017 +0530
@@ -133,6 +133,7 @@
   adding file changes
   added 4 changesets with 4 changes to 1 files (+1 heads)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "d740e1a584e7: a5.2"
   1 other heads for branch "branchA"
 
 Make changes on new branch on tt
--- a/tests/test-pull-update.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-pull-update.t	Tue Jun 06 22:17:39 2017 +0530
@@ -41,6 +41,7 @@
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "800c91d5bfc1: m"
   1 other heads for branch "default"
 
   $ cd ../tt
@@ -55,6 +56,7 @@
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "107cefe13e42: m"
   1 other heads for branch "default"
 
   $ HGMERGE=true hg merge
--- a/tests/test-rebase-pull.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-rebase-pull.t	Tue Jun 06 22:17:39 2017 +0530
@@ -347,6 +347,7 @@
   added 1 changesets with 1 changes to 1 files (+1 heads)
   nothing to rebase - updating instead
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "65bc164c1d9b: R6"
   1 other heads for branch "default"
   $ hg tglog
   @  9: 'R6'
--- a/tests/test-strip.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-strip.t	Tue Jun 06 22:17:39 2017 +0530
@@ -287,6 +287,7 @@
 
   $ hg up
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "264128213d29: c"
   1 other heads for branch "default"
   $ hg log -G
   @  changeset:   4:264128213d29
--- a/tests/test-subrepo.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-subrepo.t	Tue Jun 06 22:17:39 2017 +0530
@@ -680,6 +680,7 @@
   $ cd ../t
   $ hg up -C # discard our earlier merge
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "c373c8102e68: 12"
   2 other heads for branch "default"
   $ echo blah > t/t
   $ hg ci -m13
@@ -694,6 +695,7 @@
 
   $ hg up -C # discard changes
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "925c17564ef8: 13"
   2 other heads for branch "default"
 
 pull
@@ -736,6 +738,7 @@
   adding file changes
   added 1 changesets with 1 changes to 1 files
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "925c17564ef8: 13"
   2 other heads for branch "default"
   $ cat t/t
   blah
@@ -1212,6 +1215,7 @@
   ? s/c
   $ hg update -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "925c17564ef8: 13"
   2 other heads for branch "default"
   $ hg status -S
   ? s/b
--- a/tests/test-transplant.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-transplant.t	Tue Jun 06 22:17:39 2017 +0530
@@ -419,6 +419,7 @@
 
   $ hg up -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "e8643552fde5: foobar"
   1 other heads for branch "default"
   $ rm added
   $ hg transplant --continue
--- a/tests/test-up-local-change.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-up-local-change.t	Tue Jun 06 22:17:39 2017 +0530
@@ -172,6 +172,7 @@
   
   $ hg --debug up
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "1e71731e6fbb: 2"
   1 other heads for branch "default"
 
 test conflicting untracked files
--- a/tests/test-update-branches.t	Fri May 19 20:29:11 2017 -0700
+++ b/tests/test-update-branches.t	Tue Jun 06 22:17:39 2017 +0530
@@ -94,6 +94,7 @@
 
   $ norevtest 'none clean same'   clean 2
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "bd10386d478c: 2"
   1 other heads for branch "default"
   parent=2
 
@@ -141,6 +142,7 @@
 
   $ norevtest 'none dirty cross'  dirty 2
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "bd10386d478c: 2"
   1 other heads for branch "default"
   parent=2
   M foo
@@ -177,6 +179,7 @@
 
   $ norevtest '-c clean same'   clean 2 -c
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to "bd10386d478c: 2"
   1 other heads for branch "default"
   parent=2