commands: move activebookmarklabel to bookmarks module
This is going to be used in an upcoming patch that moves more methods to
bookmarks.py.
--- a/mercurial/bookmarks.py Tue Jun 20 15:36:43 2017 -0700
+++ b/mercurial/bookmarks.py Tue Jun 20 15:56:29 2017 -0700
@@ -25,6 +25,12 @@
util,
)
+# 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'
+
def _getbkfile(repo):
"""Hook so that extensions that mess with the store can hook bm storage.
--- a/mercurial/commands.py Tue Jun 20 15:36:43 2017 -0700
+++ b/mercurial/commands.py Tue Jun 20 15:56:29 2017 -0700
@@ -66,12 +66,6 @@
command = registrar.command(table)
-# 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 = [
@@ -994,7 +988,7 @@
for bmark, n in sorted(marks.iteritems()):
active = repo._activebookmark
if bmark == active:
- prefix, label = '*', activebookmarklabel
+ prefix, label = '*', bookmarks.activebookmarklabel
else:
prefix, label = ' ', ''
@@ -4816,10 +4810,10 @@
ui.write(_('bookmarks:'), label='log.bookmark')
if active is not None:
if active in marks:
- ui.write(' *' + active, label=activebookmarklabel)
+ ui.write(' *' + active, label=bookmarks.activebookmarklabel)
marks.remove(active)
else:
- ui.write(' [%s]' % active, label=activebookmarklabel)
+ ui.write(' [%s]' % active, label=bookmarks.activebookmarklabel)
for m in marks:
ui.write(' ' + m, label='log.bookmark')
ui.write('\n', label='log.bookmark')