# HG changeset patch # User Pierre-Yves David # Date 1470992966 -7200 # Node ID e97458bf53bef4c6eb16472f7c72e1cef2dfb00b # Parent 04ce84b7b9d149d790860328c500e6797f4bf129 stack: introduce and explicite command to display the stack If is worth testing having the feature lives outside 'hg topic --list'. The 'stack' name is sub optimal because the conflict with 'status'. using "hg st" would still work as 'st' is hard coded, but this mean 'hg stack' has no short version. diff -r 04ce84b7b9d1 -r e97458bf53be hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Thu Aug 11 22:52:49 2016 +0200 +++ b/hgext3rd/topic/__init__.py Fri Aug 12 11:09:26 2016 +0200 @@ -268,6 +268,13 @@ marker = '*' if t == current else ' ' ui.write(' %s %s\n' % (marker, t)) +@command('stack [TOPIC]', [] + commands.formatteropts) +def cmdstack(ui, repo, topic='', **opts): + """list all changesets in a topic + + List the current topic by default.""" + return stack.showstack(ui, repo, topic, opts) + def summaryhook(ui, repo): t = repo.currenttopic if not t: diff -r 04ce84b7b9d1 -r e97458bf53be tests/test-topic-stack.t --- a/tests/test-topic-stack.t Thu Aug 11 22:52:49 2016 +0200 +++ b/tests/test-topic-stack.t Fri Aug 12 11:09:26 2016 +0200 @@ -63,11 +63,11 @@ Simple test ----------- -hg topic -l list all changeset in the topic +'hg stack' list all changeset in the topic $ hg topic * foo - $ hg topic --list + $ hg stack t4@ c_f (current) t3: c_e t2: c_d @@ -77,7 +77,7 @@ error case, nothing to list $ hg topic --clear - $ hg topic --list + $ hg stack abort: no active topic to list [255]