Mercurial > hg
diff mercurial/commands.py @ 25347:ceec79b5657a
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.
author | Ryan McElroy <rmcelroy@fb.com> |
---|---|
date | Thu, 16 Apr 2015 15:18:59 -0700 |
parents | 9bc11716bc86 |
children | 62da2d7745f9 |
line wrap: on
line diff
--- a/mercurial/commands.py Sat May 30 02:06:09 2015 +0800 +++ b/mercurial/commands.py Thu Apr 16 15:18:59 2015 -0700 @@ -40,6 +40,12 @@ # @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 @@ 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 @@ 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')