changeset 29902:a77d48219edd

update: label bookmark name in message We label bookmark name as such in various messages. This will help them to standout (or at least give the user the option to make them stand out). We use a distinct label for the 'active' bookmark, this can help users to catch bookmark operation affecting their working copy.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 22 Aug 2016 14:44:14 +0200
parents 4d1e6f91f1c7
children fe81c953f369
files mercurial/hg.py
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Tue Sep 06 09:43:25 2016 -0700
+++ b/mercurial/hg.py	Mon Aug 22 14:44:14 2016 +0200
@@ -738,20 +738,22 @@
             if movemarkfrom == repo['.'].node():
                 pass # no-op update
             elif bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
-                ui.status(_("updating bookmark %s\n") % repo._activebookmark)
+                b = ui.label(repo._activebookmark, 'bookmarks.active')
+                ui.status(_("updating bookmark %s\n") % b)
             else:
                 # this can happen with a non-linear update
-                ui.status(_("(leaving bookmark %s)\n") %
-                          repo._activebookmark)
+                b = ui.label(repo._activebookmark, 'bookmarks')
+                ui.status(_("(leaving bookmark %s)\n") % b)
                 bookmarks.deactivate(repo)
         elif brev in repo._bookmarks:
             if brev != repo._activebookmark:
-                ui.status(_("(activating bookmark %s)\n") % brev)
+                b = ui.label(brev, 'bookmarks.active')
+                ui.status(_("(activating bookmark %s)\n") % b)
             bookmarks.activate(repo, brev)
         elif brev:
             if repo._activebookmark:
-                ui.status(_("(leaving bookmark %s)\n") %
-                          repo._activebookmark)
+                b = ui.label(repo._activebookmark, 'bookmarks')
+                ui.status(_("(leaving bookmark %s)\n") % b)
             bookmarks.deactivate(repo)
 
         if warndest: