hgext3rd/topic/__init__.py
changeset 2668 1d2c66dc4ee3
parent 2667 e7079bba383d
child 2669 b933a8068c17
equal deleted inserted replaced
2667:e7079bba383d 2668:1d2c66dc4ee3
   127     if topicrev.match(name):
   127     if topicrev.match(name):
   128         idx = int(name[1:])
   128         idx = int(name[1:])
   129         topic = repo.currenttopic
   129         topic = repo.currenttopic
   130         if not topic:
   130         if not topic:
   131             raise error.Abort(_('cannot resolve "%s": no active topic') % name)
   131             raise error.Abort(_('cannot resolve "%s": no active topic') % name)
   132         revs = list(stack.getstack(repo, topic))
   132         revs = list(stack.getstack(repo, topic=topic))
   133         try:
   133         try:
   134             r = revs[idx - 1]
   134             r = revs[idx - 1]
   135         except IndexError:
   135         except IndexError:
   136             msg = _('cannot resolve "%s": topic "%s" has only %d changesets')
   136             msg = _('cannot resolve "%s": topic "%s" has only %d changesets')
   137             raise error.Abort(msg % (name, topic, len(revs)))
   137             raise error.Abort(msg % (name, topic, len(revs)))
   310     List the current topic by default."""
   310     List the current topic by default."""
   311     if not topic:
   311     if not topic:
   312         topic = repo.currenttopic
   312         topic = repo.currenttopic
   313     if not topic:
   313     if not topic:
   314         raise error.Abort(_('no active topic to list'))
   314         raise error.Abort(_('no active topic to list'))
   315     return stack.showstack(ui, repo, topic, opts)
   315     return stack.showstack(ui, repo, topic=topic, opts=opts)
   316 
   316 
   317 def _changecurrenttopic(repo, newtopic):
   317 def _changecurrenttopic(repo, newtopic):
   318     """changes the current topic."""
   318     """changes the current topic."""
   319 
   319 
   320     if newtopic:
   320     if newtopic:
   418             fm.plain(' %s ' % marker, label=label)
   418             fm.plain(' %s ' % marker, label=label)
   419         fm.write('topic', namemask, topic, label=label)
   419         fm.write('topic', namemask, topic, label=label)
   420         fm.data(active=active)
   420         fm.data(active=active)
   421         if ui.verbose:
   421         if ui.verbose:
   422             # XXX we should include the data even when not verbose
   422             # XXX we should include the data even when not verbose
   423             data = stack.stackdata(repo, topic)
   423             data = stack.stackdata(repo, topic=topic)
   424             fm.plain(' (')
   424             fm.plain(' (')
   425             fm.write('branches+', 'on branch: %s',
   425             fm.write('branches+', 'on branch: %s',
   426                      '+'.join(data['branches']), # XXX use list directly after 4.0 is released
   426                      '+'.join(data['branches']), # XXX use list directly after 4.0 is released
   427                      label='topic.list.branches')
   427                      label='topic.list.branches')
   428             fm.plain(', ')
   428             fm.plain(', ')