update: show message when a bookmark is activated by update
When updating to a bookmark, mention that the bookmark is now
active. This is a reminder that update does not move the
current bookmark if an explicit target is given - instead
it activates that target.
--- a/mercurial/commands.py Tue Apr 22 10:01:22 2014 -0700
+++ b/mercurial/commands.py Thu Mar 07 14:17:56 2013 +1100
@@ -5889,6 +5889,7 @@
ui.status(_("updating bookmark %s\n") % repo._bookmarkcurrent)
elif brev in repo._bookmarks:
bookmarks.setcurrent(repo, brev)
+ ui.status(_("(activating bookmark %s)\n") % brev)
elif brev:
if repo._bookmarkcurrent:
ui.status(_("(leaving bookmark %s)\n") %
--- a/tests/test-bookmarks-current.t Tue Apr 22 10:01:22 2014 -0700
+++ b/tests/test-bookmarks-current.t Thu Mar 07 14:17:56 2013 +1100
@@ -24,6 +24,7 @@
$ hg update X
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (activating bookmark X)
list bookmarks
@@ -71,6 +72,7 @@
Verify that switching to Z updates the current bookmark:
$ hg update Z
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (activating bookmark Z)
$ hg bookmark
Y 0:719295282060
* Z -1:000000000000
@@ -78,6 +80,7 @@
Switch back to Y for the remaining tests in this file:
$ hg update Y
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (activating bookmark Y)
delete bookmarks
@@ -152,6 +155,7 @@
$ hg bookmark X@2 -r 2
$ hg update X
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (activating bookmark X)
$ hg bookmarks
* X 0:719295282060
X@1 1:cc586d725fbe
--- a/tests/test-bookmarks-merge.t Tue Apr 22 10:01:22 2014 -0700
+++ b/tests/test-bookmarks-merge.t Thu Mar 07 14:17:56 2013 +1100
@@ -65,6 +65,7 @@
$ hg up -C e
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (activating bookmark e)
$ hg merge
abort: no matching bookmark to merge - please merge with an explicit rev or bookmark
(run 'hg heads' to see all heads)
@@ -99,6 +100,7 @@
$ hg up -C e
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (activating bookmark e)
$ hg bookmarks
b 1:d2ae7f538514
c 3:b8f96cf4688b
--- a/tests/test-bookmarks.t Tue Apr 22 10:01:22 2014 -0700
+++ b/tests/test-bookmarks.t Thu Mar 07 14:17:56 2013 +1100
@@ -118,6 +118,7 @@
$ hg update X
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (activating bookmark X)
$ echo c > c
$ hg add c
$ hg commit -m 2
@@ -501,6 +502,7 @@
$ hg update
updating to active bookmark Z
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (activating bookmark Z)
$ hg bookmarks
X2 1:925d80f479bb
Y 2:db815d6d32e6
@@ -513,6 +515,7 @@
moving bookmark 'Y' forward from db815d6d32e6
$ hg -R cloned-bookmarks-update update Y
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (activating bookmark Y)
$ hg -R cloned-bookmarks-update pull --update .
pulling from .
searching for changes
--- a/tests/test-strip.t Tue Apr 22 10:01:22 2014 -0700
+++ b/tests/test-strip.t Thu Mar 07 14:17:56 2013 +1100
@@ -490,6 +490,7 @@
$ hg bookmark -r 'c' 'delete'
$ hg up -C todelete
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (activating bookmark todelete)
$ hg strip -B nostrip
bookmark 'nostrip' deleted
abort: empty revision set
--- a/tests/test-subrepo-svn.t Tue Apr 22 10:01:22 2014 -0700
+++ b/tests/test-subrepo-svn.t Thu Mar 07 14:17:56 2013 +1100
@@ -482,6 +482,7 @@
A *obstruct/other (glob)
Checked out revision 1.
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (activating bookmark other)
This is surprising, but is also correct based on the current code:
$ echo "updating should (maybe) fail" > obstruct/other