Mercurial > evolve
diff 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 |
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py Mon Mar 14 18:40:00 2016 +0000 +++ b/hgext3rd/topic/stack.py Mon Mar 14 18:43:23 2016 +0000 @@ -20,7 +20,21 @@ raise error.Abort(_('no active topic to list')) for idx, r in enumerate(getstack(repo, topic)): # super crude initial version - l = "t%d: %s\n" % (idx, repo[r].description().splitlines()[0]) + symbol = ':' + state = 'clean' + if repo.revs('%d and parents()', r): + symbol = '@' + state = 'current' + if repo.revs('%d and unstable()', r): + symbol = '$' + state = 'unstable' + if state == 'clean': + l = "t%d%s %s\n" % (idx, symbol, + repo[r].description().splitlines()[0]) + else: + l = "t%d%s %s (%s)\n" % (idx, symbol, + repo[r].description().splitlines()[0], + state) ui.write(l) # Copied from evolve 081605c2e9b6