mercurial/commands.py
changeset 25347 ceec79b5657a
parent 25304 9bc11716bc86
child 25349 62da2d7745f9
equal deleted inserted replaced
25346:fe0aac1082f3 25347:ceec79b5657a
    37 optionalrepo = ''
    37 optionalrepo = ''
    38 # Space delimited list of commands that will examine arguments looking for
    38 # Space delimited list of commands that will examine arguments looking for
    39 # a repository. This should be populated by passing inferrepo=True into the
    39 # a repository. This should be populated by passing inferrepo=True into the
    40 # @command decorator.
    40 # @command decorator.
    41 inferrepo = ''
    41 inferrepo = ''
       
    42 
       
    43 # label constants
       
    44 # until 3.5, bookmarks.current was the advertised name, not
       
    45 # bookmarks.active, so we must use both to avoid breaking old
       
    46 # custom styles
       
    47 activebookmarklabel = 'bookmarks.active bookmarks.current'
    42 
    48 
    43 # common command options
    49 # common command options
    44 
    50 
    45 globalopts = [
    51 globalopts = [
    46     ('R', 'repository', '',
    52     ('R', 'repository', '',
  1035         if len(marks) == 0 and not fm:
  1041         if len(marks) == 0 and not fm:
  1036             ui.status(_("no bookmarks set\n"))
  1042             ui.status(_("no bookmarks set\n"))
  1037         for bmark, n in sorted(marks.iteritems()):
  1043         for bmark, n in sorted(marks.iteritems()):
  1038             current = repo._activebookmark
  1044             current = repo._activebookmark
  1039             if bmark == current:
  1045             if bmark == current:
  1040                 prefix, label = '*', 'bookmarks.current'
  1046                 prefix, label = '*', activebookmarklabel
  1041             else:
  1047             else:
  1042                 prefix, label = ' ', ''
  1048                 prefix, label = ' ', ''
  1043 
  1049 
  1044             fm.startitem()
  1050             fm.startitem()
  1045             if not ui.quiet:
  1051             if not ui.quiet:
  5930         current = repo._activebookmark
  5936         current = repo._activebookmark
  5931         # i18n: column positioning for "hg summary"
  5937         # i18n: column positioning for "hg summary"
  5932         ui.write(_('bookmarks:'), label='log.bookmark')
  5938         ui.write(_('bookmarks:'), label='log.bookmark')
  5933         if current is not None:
  5939         if current is not None:
  5934             if current in marks:
  5940             if current in marks:
  5935                 ui.write(' *' + current, label='bookmarks.current')
  5941                 ui.write(' *' + current, label=activebookmarklabel)
  5936                 marks.remove(current)
  5942                 marks.remove(current)
  5937             else:
  5943             else:
  5938                 ui.write(' [%s]' % current, label='bookmarks.current')
  5944                 ui.write(' [%s]' % current, label=activebookmarklabel)
  5939         for m in marks:
  5945         for m in marks:
  5940             ui.write(' ' + m, label='log.bookmark')
  5946             ui.write(' ' + m, label='log.bookmark')
  5941         ui.write('\n', label='log.bookmark')
  5947         ui.write('\n', label='log.bookmark')
  5942 
  5948 
  5943     status = repo.status(unknown=True)
  5949     status = repo.status(unknown=True)