# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-06-06 16:47:39 # Node ID 1b5c61d38a5211ff8e096f0e48195100957b4136 # Parent 19b9fc40cc51b487b6307a4a22a051ca686ba82e 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. diff --git a/mercurial/destutil.py b/mercurial/destutil.py --- a/mercurial/destutil.py +++ b/mercurial/destutil.py @@ -391,6 +391,9 @@ def _statusotherbranchheads(ui, repo): 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)) diff --git a/tests/test-bisect2.t b/tests/test-bisect2.t --- a/tests/test-bisect2.t +++ b/tests/test-bisect2.t @@ -244,6 +244,7 @@ hg up -C $ 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 diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -137,6 +137,7 @@ extension and python hooks - use the eol $ 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 diff --git a/tests/test-conflict.t b/tests/test-conflict.t --- a/tests/test-conflict.t +++ b/tests/test-conflict.t @@ -220,6 +220,7 @@ are merging, unlike :local and :other $ 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 @@ Now test :merge-other and :merge-local $ 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 diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t --- a/tests/test-largefiles-cache.t +++ b/tests/test-largefiles-cache.t @@ -206,6 +206,7 @@ Inject corruption into the largefiles st 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 diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t --- a/tests/test-largefiles-update.t +++ b/tests/test-largefiles-update.t @@ -71,6 +71,7 @@ we don't have to hash them again next ti $ 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 @@ prevents unnecessary hashing of content 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 @@ Test that the internal linear merging wo 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 @@ Test that the internal linear merging wo 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 diff --git a/tests/test-merge-changedelete.t b/tests/test-merge-changedelete.t --- a/tests/test-merge-changedelete.t +++ b/tests/test-merge-changedelete.t @@ -114,6 +114,7 @@ Interactive merge: $ 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 < 2 heads: diff --git a/tests/test-merge-types.t b/tests/test-merge-types.t --- a/tests/test-merge-types.t +++ b/tests/test-merge-types.t @@ -155,6 +155,7 @@ Update to link without local change shou 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 @@ Update to link with local change should 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 diff --git a/tests/test-pull-branch.t b/tests/test-pull-branch.t --- a/tests/test-pull-branch.t +++ b/tests/test-pull-branch.t @@ -133,6 +133,7 @@ Should succeed because there is only one 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 diff --git a/tests/test-pull-update.t b/tests/test-pull-update.t --- a/tests/test-pull-update.t +++ b/tests/test-pull-update.t @@ -41,6 +41,7 @@ Should not update to the other topologic 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 @@ Should not update to the other branch: 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 diff --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t --- a/tests/test-rebase-pull.t +++ b/tests/test-rebase-pull.t @@ -347,6 +347,7 @@ pull --rebase update (no rebase) use pro 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' diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -287,6 +287,7 @@ after strip of merge parent $ 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 diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t --- a/tests/test-subrepo.t +++ b/tests/test-subrepo.t @@ -680,6 +680,7 @@ update $ 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 @@ KeyError $ 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 @@ should pull t 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 @@ Check hg update --clean ? 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 diff --git a/tests/test-transplant.t b/tests/test-transplant.t --- a/tests/test-transplant.t +++ b/tests/test-transplant.t @@ -419,6 +419,7 @@ transplant -c shouldn't use an old chang $ 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 diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t --- a/tests/test-up-local-change.t +++ b/tests/test-up-local-change.t @@ -172,6 +172,7 @@ create a second head $ 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 diff --git a/tests/test-update-branches.t b/tests/test-update-branches.t --- a/tests/test-update-branches.t +++ b/tests/test-update-branches.t @@ -94,6 +94,7 @@ Cases are run as shown in that table, ro $ 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 @@ Cases are run as shown in that table, ro $ 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 @@ Cases are run as shown in that table, ro $ 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