# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1497822215 -19800 # Node ID 42abd3bd30ee9817056d6d364c7f6e34f14d156d # Parent bc36a608e9e44833053c60e6b7d0305399e2afb1 topics: abort if user wants to show the stack of a non-existent topic diff -r bc36a608e9e4 -r 42abd3bd30ee README --- a/README Mon Jun 19 02:50:35 2017 +0530 +++ b/README Mon Jun 19 03:13:35 2017 +0530 @@ -125,6 +125,7 @@ ------------------- - stack: also show the unstable status for the current changeset (issue5553) + - stack: properly abort when and unknown topic is requested, - topic: fix issue5441 in the linear case, 6.4.0 -- 2017-06-16 diff -r bc36a608e9e4 -r 42abd3bd30ee hgext3rd/topic/stack.py --- a/hgext3rd/topic/stack.py Mon Jun 19 02:50:35 2017 +0530 +++ b/hgext3rd/topic/stack.py Mon Jun 19 03:13:35 2017 +0530 @@ -22,6 +22,10 @@ return ' '.join(prefix % suffix for suffix in labelssuffix) def showstack(ui, repo, topic, opts): + + if topic not in repo.topics: + raise error.Abort(_('cannot resolve "%s": no such topic found') % topic) + fm = ui.formatter('topicstack', opts) prev = None entries = [] diff -r bc36a608e9e4 -r 42abd3bd30ee tests/test-topic-stack.t --- a/tests/test-topic-stack.t Mon Jun 19 02:50:35 2017 +0530 +++ b/tests/test-topic-stack.t Mon Jun 19 03:13:35 2017 +0530 @@ -319,3 +319,11 @@ t2@ c_D (current) t1: c_c ^ c_b + +Trying to list non existing topic + $ hg stack thisdoesnotexist + abort: cannot resolve "thisdoesnotexist": no such topic found + [255] + $ hg topic --list thisdoesnotexist + abort: cannot resolve "thisdoesnotexist": no such topic found + [255]