Mercurial > evolve
comparison hgext3rd/topic/stack.py @ 3084:144989dabe93
stack: show current and unstable also for t0 and bases
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 15 Oct 2017 00:03:59 +0530 |
parents | 6f87042766cb |
children | 3eca2cbdc498 |
comparison
equal
deleted
inserted
replaced
3083:e91ca8b5ecf7 | 3084:144989dabe93 |
---|---|
273 prev = r | 273 prev = r |
274 | 274 |
275 # super crude initial version | 275 # super crude initial version |
276 for idx, isentry, ctx in entries[::-1]: | 276 for idx, isentry, ctx in entries[::-1]: |
277 | 277 |
278 symbol = None | |
278 states = [] | 279 states = [] |
279 iscurrentrevision = repo.revs('%d and parents()', ctx.rev()) | 280 iscurrentrevision = repo.revs('%d and parents()', ctx.rev()) |
281 | |
282 if iscurrentrevision: | |
283 states.append('current') | |
284 symbol = '@' | |
285 | |
286 if ctx.orphan(): | |
287 symbol = '$' | |
288 states.append('unstable') | |
280 | 289 |
281 if not isentry: | 290 if not isentry: |
282 symbol = '^' | 291 symbol = '^' |
283 # "base" is kind of a "ghost" entry | 292 # "base" is kind of a "ghost" entry |
284 # skip other label for them (no current, no unstable) | 293 states.append('base') |
285 states = ['base'] | 294 |
286 elif ctx.orphan(): | 295 # none of the above if statments get executed |
287 # current revision can be unstable also, so in that case show both | 296 if not symbol: |
288 # the states and the symbol '@' (issue5553) | |
289 if iscurrentrevision: | |
290 states.append('current') | |
291 symbol = '@' | |
292 symbol = '$' | |
293 states.append('unstable') | |
294 elif iscurrentrevision: | |
295 states.append('current') | |
296 symbol = '@' | |
297 else: | |
298 symbol = ':' | 297 symbol = ':' |
299 states.append('clean') | 298 states.append('clean') |
300 fm.startitem() | 299 fm.startitem() |
301 fm.data(isentry=isentry) | 300 fm.data(isentry=isentry) |
302 | 301 |