Patchwork [2,of,2] update: show message when a bookmark is activated by update

login
register
mail settings
Submitter Stephen Lee
Date March 11, 2014, 9:10 a.m.
Message ID <7d7c963bc88e63e6dff3.1394529007@slee-desktop>
Download mbox | patch
Permalink /patch/3909/
State Superseded
Headers show

Comments

Stephen Lee - March 11, 2014, 9:10 a.m.
# HG changeset patch
# User Stephen Lee <sphen.lee@gmail.com>
# Date 1362626276 -39600
#      Thu Mar 07 14:17:56 2013 +1100
# Node ID 7d7c963bc88e63e6dff3971ba389b983a0cc29fa
# Parent  0573ffab1d3878b637a95bf6ff7bf172facedc1c
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.
Matt Mackall - April 16, 2014, 9:47 p.m.
On Tue, 2014-03-11 at 20:10 +1100, Stephen Lee wrote:
> # HG changeset patch
> # User Stephen Lee <sphen.lee@gmail.com>
> # Date 1362626276 -39600
> #      Thu Mar 07 14:17:56 2013 +1100
> # Node ID 7d7c963bc88e63e6dff3971ba389b983a0cc29fa
> # Parent  0573ffab1d3878b637a95bf6ff7bf172facedc1c
> update: show message when a bookmark is activated by update

This seems fine, but I think it's actually more important that we
mention bookmark deactivation. We probably don't want to have just this
piece. Perhaps something for after the freeze.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5836,6 +5836,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:
         bookmarks.unsetcurrent(repo)
 
diff --git a/tests/test-bookmarks-current.t b/tests/test-bookmarks-current.t
--- a/tests/test-bookmarks-current.t
+++ b/tests/test-bookmarks-current.t
@@ -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
diff --git a/tests/test-bookmarks-merge.t b/tests/test-bookmarks-merge.t
--- a/tests/test-bookmarks-merge.t
+++ b/tests/test-bookmarks-merge.t
@@ -63,6 +63,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)
@@ -96,6 +97,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
diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
--- a/tests/test-bookmarks.t
+++ b/tests/test-bookmarks.t
@@ -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
diff --git a/tests/test-strip.t b/tests/test-strip.t
--- a/tests/test-strip.t
+++ b/tests/test-strip.t
@@ -477,6 +477,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
diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t
--- a/tests/test-subrepo-svn.t
+++ b/tests/test-subrepo-svn.t
@@ -481,6 +481,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