Mercurial > evolve
comparison hgext3rd/topic/stack.py @ 2750:bd3824d1b795
stack: show short node of changesets in `hg stack -v`
After this patch, hg stack -v shows short nodes for changesets which have topic
index, i.e. excluding the bases except t0.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 14 Jul 2017 07:19:15 +0530 |
parents | f19b314d8475 |
children | 1c9150e30b28 |
comparison
equal
deleted
inserted
replaced
2749:e1b7ea48e243 | 2750:bd3824d1b795 |
---|---|
7 destutil, | 7 destutil, |
8 error, | 8 error, |
9 node, | 9 node, |
10 ) | 10 ) |
11 from .evolvebits import builddependencies, _orderrevs, _singlesuccessor | 11 from .evolvebits import builddependencies, _orderrevs, _singlesuccessor |
12 | |
13 short = node.short | |
12 | 14 |
13 def getstack(repo, branch=None, topic=None): | 15 def getstack(repo, branch=None, topic=None): |
14 # XXX need sorting | 16 # XXX need sorting |
15 if topic is not None and branch is not None: | 17 if topic is not None and branch is not None: |
16 raise error.ProgrammingError('both branch and topic specified (not defined yet)') | 18 raise error.ProgrammingError('both branch and topic specified (not defined yet)') |
137 fm.startitem() | 139 fm.startitem() |
138 fm.data(isentry=isentry) | 140 fm.data(isentry=isentry) |
139 | 141 |
140 if idx is None: | 142 if idx is None: |
141 fm.plain(' ') | 143 fm.plain(' ') |
144 if ui.verbose: | |
145 fm.plain(' ') | |
142 else: | 146 else: |
143 fm.write('topic.stack.index', '%s%%d' % prefix, idx, | 147 fm.write('topic.stack.index', '%s%%d' % prefix, idx, |
144 label='topic.stack.index ' + labelsgen('topic.stack.index.%s', states)) | 148 label='topic.stack.index ' + labelsgen('topic.stack.index.%s', states)) |
149 if ui.verbose: | |
150 fm.write('topic.stack.shortnode', '(%s)', short(ctx.node()), | |
151 label='topic.stack.shortnode ' + labelsgen('topic.stack.shortnode.%s', states)) | |
145 fm.write('topic.stack.state.symbol', '%s', symbol, | 152 fm.write('topic.stack.state.symbol', '%s', symbol, |
146 label='topic.stack.state ' + labelsgen('topic.stack.state.%s', states)) | 153 label='topic.stack.state ' + labelsgen('topic.stack.state.%s', states)) |
147 fm.plain(' ') | 154 fm.plain(' ') |
148 fm.write('topic.stack.desc', '%s', ctx.description().splitlines()[0], | 155 fm.write('topic.stack.desc', '%s', ctx.description().splitlines()[0], |
149 label='topic.stack.desc ' + labelsgen('topic.stack.desc.%s', states)) | 156 label='topic.stack.desc ' + labelsgen('topic.stack.desc.%s', states)) |