Patchwork update: label bookmark name in message

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 7, 2016, 10:54 a.m.
Message ID <6c5f481a3d333b46c806.1473245699@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/16569/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 7, 2016, 10:54 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1471869854 -7200
#      Mon Aug 22 14:44:14 2016 +0200
# Node ID 6c5f481a3d333b46c80646955cbc6838eaa57846
# Parent  4d6372307f4832b0f4aad5714d5610d35bcfa022
# EXP-Topic bookmark.label
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.
Yuya Nishihara - Sept. 7, 2016, 2:04 p.m.
On Wed, 07 Sep 2016 12:54:59 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1471869854 -7200
> #      Mon Aug 22 14:44:14 2016 +0200
> # Node ID 6c5f481a3d333b46c80646955cbc6838eaa57846
> # Parent  4d6372307f4832b0f4aad5714d5610d35bcfa022
> # EXP-Topic bookmark.label
> update: label bookmark name in message

Sounds good. Queued, thanks.

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -738,20 +738,22 @@  def updatetotally(ui, repo, checkout, br
             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: