comparison mercurial/commands.py @ 33009:4b81776baa7a

commands: move activebookmarklabel to bookmarks module This is going to be used in an upcoming patch that moves more methods to bookmarks.py.
author Sean Farley <sean@farley.io>
date Tue, 20 Jun 2017 15:56:29 -0700
parents ac57603a44fe
children f5f4c72de71a
comparison
equal deleted inserted replaced
33008:ac57603a44fe 33009:4b81776baa7a
63 63
64 table = {} 64 table = {}
65 table.update(debugcommandsmod.command._table) 65 table.update(debugcommandsmod.command._table)
66 66
67 command = registrar.command(table) 67 command = registrar.command(table)
68
69 # label constants
70 # until 3.5, bookmarks.current was the advertised name, not
71 # bookmarks.active, so we must use both to avoid breaking old
72 # custom styles
73 activebookmarklabel = 'bookmarks.active bookmarks.current'
74 68
75 # common command options 69 # common command options
76 70
77 globalopts = [ 71 globalopts = [
78 ('R', 'repository', '', 72 ('R', 'repository', '',
992 if len(marks) == 0 and fm.isplain(): 986 if len(marks) == 0 and fm.isplain():
993 ui.status(_("no bookmarks set\n")) 987 ui.status(_("no bookmarks set\n"))
994 for bmark, n in sorted(marks.iteritems()): 988 for bmark, n in sorted(marks.iteritems()):
995 active = repo._activebookmark 989 active = repo._activebookmark
996 if bmark == active: 990 if bmark == active:
997 prefix, label = '*', activebookmarklabel 991 prefix, label = '*', bookmarks.activebookmarklabel
998 else: 992 else:
999 prefix, label = ' ', '' 993 prefix, label = ' ', ''
1000 994
1001 fm.startitem() 995 fm.startitem()
1002 if not ui.quiet: 996 if not ui.quiet:
4814 active = repo._activebookmark 4808 active = repo._activebookmark
4815 # i18n: column positioning for "hg summary" 4809 # i18n: column positioning for "hg summary"
4816 ui.write(_('bookmarks:'), label='log.bookmark') 4810 ui.write(_('bookmarks:'), label='log.bookmark')
4817 if active is not None: 4811 if active is not None:
4818 if active in marks: 4812 if active in marks:
4819 ui.write(' *' + active, label=activebookmarklabel) 4813 ui.write(' *' + active, label=bookmarks.activebookmarklabel)
4820 marks.remove(active) 4814 marks.remove(active)
4821 else: 4815 else:
4822 ui.write(' [%s]' % active, label=activebookmarklabel) 4816 ui.write(' [%s]' % active, label=bookmarks.activebookmarklabel)
4823 for m in marks: 4817 for m in marks:
4824 ui.write(' ' + m, label='log.bookmark') 4818 ui.write(' ' + m, label='log.bookmark')
4825 ui.write('\n', label='log.bookmark') 4819 ui.write('\n', label='log.bookmark')
4826 4820
4827 status = repo.status(unknown=True) 4821 status = repo.status(unknown=True)