# HG changeset patch # User Pierre-Yves David # Date 1457979873 0 # Node ID 2b65c5a6591ca148f53f28cec524a86f07ec78d1 # Parent 38570c53b1cf4245f0dd438c432939052dccfecf task: add index number to the output We are doing to use these number for easy movement in later changesets. The numbering will probably evolve over time but this is a good start. diff --git a/src/topic/stack.py b/src/topic/stack.py --- a/src/topic/stack.py +++ b/src/topic/stack.py @@ -18,10 +18,10 @@ topic = repo.currenttopic if not topic: raise error.Abort(_('no active topic to list')) - for r in _getstack(repo, topic): + for idx, r in enumerate(_getstack(repo, topic)): # super crude initial version - ui.write(repo[r].description().splitlines()[0] + '\n') - + l = "%d: %s\n" % (idx, repo[r].description().splitlines()[0]) + ui.write(l) # Copied from evolve 081605c2e9b6 diff --git a/tests/test-topic-stack.t b/tests/test-topic-stack.t --- a/tests/test-topic-stack.t +++ b/tests/test-topic-stack.t @@ -57,10 +57,10 @@ $ hg topic * foo $ hg topic --list - c_c - c_d - c_e - c_f + 0: c_c + 1: c_d + 2: c_e + 3: c_f error case, nothing to list @@ -93,7 +93,7 @@ o 0 default {} draft c_a $ hg topic --list - c_c - c_d - c_e - c_f + 0: c_c + 1: c_d + 2: c_e + 3: c_f