Mercurial > evolve
comparison hgext3rd/topic/stack.py @ 2627:42abd3bd30ee
topics: abort if user wants to show the stack of a non-existent topic
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 19 Jun 2017 03:13:35 +0530 |
parents | bc36a608e9e4 |
children | 62eb5a2d2112 |
comparison
equal
deleted
inserted
replaced
2626:bc36a608e9e4 | 2627:42abd3bd30ee |
---|---|
20 formatted with each suffix separated with a space. | 20 formatted with each suffix separated with a space. |
21 """ | 21 """ |
22 return ' '.join(prefix % suffix for suffix in labelssuffix) | 22 return ' '.join(prefix % suffix for suffix in labelssuffix) |
23 | 23 |
24 def showstack(ui, repo, topic, opts): | 24 def showstack(ui, repo, topic, opts): |
25 | |
26 if topic not in repo.topics: | |
27 raise error.Abort(_('cannot resolve "%s": no such topic found') % topic) | |
28 | |
25 fm = ui.formatter('topicstack', opts) | 29 fm = ui.formatter('topicstack', opts) |
26 prev = None | 30 prev = None |
27 entries = [] | 31 entries = [] |
28 idxmap = {} | 32 idxmap = {} |
29 | 33 |