comparison hgext/rebase.py @ 34290:4f969b9e0cf5

rebase: also include other namespaces in changeset description This makes use of the generic method of listing bookmarks and tags, so other extensions that add other namespaces will get their names added too. This does mean that bookmarks will come before tags, just like we apparently decided to order them in the "hg log" output. It doesn't seem like people would be parsing the rebase output anyway. We also did 79ab5369d55a (rebase: use _ctxdesc in one more place, 2017-08-29) recently, so now seems like a good time. Differential Revision: https://phab.mercurial-scm.org/D741
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 19 Sep 2017 22:06:26 -0700
parents 7471193be725
children f61f5af5ed31
comparison
equal deleted inserted replaced
34289:1d6558f5ea74 34290:4f969b9e0cf5
123 def _ctxdesc(ctx): 123 def _ctxdesc(ctx):
124 """short description for a context""" 124 """short description for a context"""
125 desc = '%d:%s "%s"' % (ctx.rev(), ctx, 125 desc = '%d:%s "%s"' % (ctx.rev(), ctx,
126 ctx.description().split('\n', 1)[0]) 126 ctx.description().split('\n', 1)[0])
127 repo = ctx.repo() 127 repo = ctx.repo()
128 names = repo.nodetags(ctx.node()) + repo.nodebookmarks(ctx.node()) 128 names = []
129 for nsname, ns in repo.names.iteritems():
130 if nsname == 'branches':
131 continue
132 names.extend(ns.names(repo, ctx.node()))
129 if names: 133 if names:
130 desc += ' (%s)' % ' '.join(names) 134 desc += ' (%s)' % ' '.join(names)
131 return desc 135 return desc
132 136
133 class rebaseruntime(object): 137 class rebaseruntime(object):