Mercurial > public > mercurial-scm > evolve
comparison hgext3rd/topic/stack.py @ 1906:5e9ce6310720
stack: show the currently active changeset and unstable ones
Still super basic, but give a basic idea of the feature. We use both symbols and
explicit text because symbols are cool but text is more explicit
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 14 Mar 2016 18:43:23 +0000 |
parents | 3b42478ef017 |
children | 95874e8fc5f2 |
comparison
equal
deleted
inserted
replaced
1905:3b42478ef017 | 1906:5e9ce6310720 |
---|---|
18 topic = repo.currenttopic | 18 topic = repo.currenttopic |
19 if not topic: | 19 if not topic: |
20 raise error.Abort(_('no active topic to list')) | 20 raise error.Abort(_('no active topic to list')) |
21 for idx, r in enumerate(getstack(repo, topic)): | 21 for idx, r in enumerate(getstack(repo, topic)): |
22 # super crude initial version | 22 # super crude initial version |
23 l = "t%d: %s\n" % (idx, repo[r].description().splitlines()[0]) | 23 symbol = ':' |
24 state = 'clean' | |
25 if repo.revs('%d and parents()', r): | |
26 symbol = '@' | |
27 state = 'current' | |
28 if repo.revs('%d and unstable()', r): | |
29 symbol = '$' | |
30 state = 'unstable' | |
31 if state == 'clean': | |
32 l = "t%d%s %s\n" % (idx, symbol, | |
33 repo[r].description().splitlines()[0]) | |
34 else: | |
35 l = "t%d%s %s (%s)\n" % (idx, symbol, | |
36 repo[r].description().splitlines()[0], | |
37 state) | |
24 ui.write(l) | 38 ui.write(l) |
25 | 39 |
26 # Copied from evolve 081605c2e9b6 | 40 # Copied from evolve 081605c2e9b6 |
27 | 41 |
28 def _orderrevs(repo, revs): | 42 def _orderrevs(repo, revs): |