hgext3rd/topic/__init__.py
changeset 1963 7b7f073ed05e
parent 1958 62d5d4206840
child 1966 e67c526c0a25
equal deleted inserted replaced
1962:c00815786813 1963:7b7f073ed05e
    45 cmdtable = {}
    45 cmdtable = {}
    46 command = cmdutil.command(cmdtable)
    46 command = cmdutil.command(cmdtable)
    47 colortable = {'topic.stack.index': 'yellow',
    47 colortable = {'topic.stack.index': 'yellow',
    48               'topic.stack.state.base': 'dim',
    48               'topic.stack.state.base': 'dim',
    49               'topic.stack.state.clean': 'green',
    49               'topic.stack.state.clean': 'green',
    50               'topic.stack.index.current': 'cyan', # random pick
    50               'topic.stack.index.current': 'cyan',       # random pick
    51               'topic.stack.state.current': 'cyan bold', # random pick
    51               'topic.stack.state.current': 'cyan bold',  # random pick
    52               'topic.stack.desc.current': 'cyan', # random pick
    52               'topic.stack.desc.current': 'cyan',        # random pick
    53               'topic.stack.state.unstable': 'red',
    53               'topic.stack.state.unstable': 'red',
    54              }
    54              }
    55 
    55 
    56 testedwith = '3.7'
    56 testedwith = '3.7'
    57 
    57 
   180         repo.names.addnamespace(namespaces.namespace(
   180         repo.names.addnamespace(namespaces.namespace(
   181             'topics', 'topic', namemap=_namemap, nodemap=_nodemap,
   181             'topics', 'topic', namemap=_namemap, nodemap=_nodemap,
   182             listnames=lambda repo: repo.topics))
   182             listnames=lambda repo: repo.topics))
   183 
   183 
   184 @command('topics [TOPIC]', [
   184 @command('topics [TOPIC]', [
   185     ('', 'clear', False, 'clear active topic if any'),
   185         ('', 'clear', False, 'clear active topic if any'),
   186     ('', 'change', '', 'revset of existing revisions to change topic'),
   186         ('', 'change', '', 'revset of existing revisions to change topic'),
   187     ('l', 'list', False, 'show the stack of changeset in the topic'),
   187         ('l', 'list', False, 'show the stack of changeset in the topic'),
   188     ] + commands.formatteropts)
   188     ] + commands.formatteropts)
   189 def topics(ui, repo, topic='', clear=False, change=None, list=False, **opts):
   189 def topics(ui, repo, topic='', clear=False, change=None, list=False, **opts):
   190     """View current topic, set current topic, or see all topics."""
   190     """View current topic, set current topic, or see all topics."""
   191     if list:
   191     if list:
   192         if clear or change:
   192         if clear or change: