# HG changeset patch # User Ryan McElroy # Date 2015-04-16 22:18:59 # Node ID ceec79b5657a306fb1c806cc20cca6e48f61b892 # Parent fe0aac1082f3faccd9f4c29908be2b0f7c98af0f bookmarks: name label for active bookmark correctly Retain old label as well for backwards compatibility. Today, the terms 'active' and 'current' are interchangeably used throughout the codebase in reference to the active bookmark (the bookmark that will be updated with the next commit). This leads to confusion among developers and users. This patch is part of a series to standardize the usage to 'active' throughout the mercurial codebase and user interface. diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -84,7 +84,7 @@ effects may be overridden from your conf resolve.unresolved = red bold resolve.resolved = green bold - bookmarks.current = green + bookmarks.active = green branches.active = none branches.closed = black bold @@ -313,7 +313,7 @@ except ImportError: 'grep.filename': 'magenta', 'grep.user': 'magenta', 'grep.date': 'magenta', - 'bookmarks.current': 'green', + 'bookmarks.active': 'green', 'branches.active': 'none', 'branches.closed': 'black bold', 'branches.current': 'green', diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -40,6 +40,12 @@ optionalrepo = '' # @command decorator. inferrepo = '' +# label constants +# until 3.5, bookmarks.current was the advertised name, not +# bookmarks.active, so we must use both to avoid breaking old +# custom styles +activebookmarklabel = 'bookmarks.active bookmarks.current' + # common command options globalopts = [ @@ -1037,7 +1043,7 @@ def bookmark(ui, repo, *names, **opts): for bmark, n in sorted(marks.iteritems()): current = repo._activebookmark if bmark == current: - prefix, label = '*', 'bookmarks.current' + prefix, label = '*', activebookmarklabel else: prefix, label = ' ', '' @@ -5932,10 +5938,10 @@ def summary(ui, repo, **opts): ui.write(_('bookmarks:'), label='log.bookmark') if current is not None: if current in marks: - ui.write(' *' + current, label='bookmarks.current') + ui.write(' *' + current, label=activebookmarklabel) marks.remove(current) else: - ui.write(' [%s]' % current, label='bookmarks.current') + ui.write(' [%s]' % current, label=activebookmarklabel) for m in marks: ui.write(' ' + m, label='log.bookmark') ui.write('\n', label='log.bookmark')