topic: add a --topic option to "outgoing" command
By symmetry with "push" in the previous changeset.
--- a/hgext3rd/topic/__init__.py Fri Sep 22 13:43:38 2017 +0200
+++ b/hgext3rd/topic/__init__.py Fri Sep 22 13:46:41 2017 +0200
@@ -198,7 +198,12 @@
entry[1].append(('t', 'topic', '',
_("use specified topic"), _('TOPIC')))
- entry = extensions.wrapcommand(commands.table, 'push', pushwrap)
+ entry = extensions.wrapcommand(commands.table, 'push', pushoutgoingwrap)
+ entry[1].append(('t', 'topic', '',
+ _("topic to push"), _('TOPIC')))
+
+ entry = extensions.wrapcommand(commands.table, 'outgoing',
+ pushoutgoingwrap)
entry[1].append(('t', 'topic', '',
_("topic to push"), _('TOPIC')))
@@ -828,7 +833,7 @@
"\nHG: topic '%s'\nHG: branch" % t)
return ret
-def pushwrap(orig, ui, repo, *args, **opts):
+def pushoutgoingwrap(orig, ui, repo, *args, **opts):
if opts.get('topic'):
topicrevs = repo.revs('topic(%s) - obsolete()', opts['topic'])
opts.setdefault('rev', []).extend(topicrevs)
--- a/tests/test-topic-push.t Fri Sep 22 13:43:38 2017 +0200
+++ b/tests/test-topic-push.t Fri Sep 22 13:46:41 2017 +0200
@@ -188,6 +188,10 @@
|/
o 0 default public CA
+ $ hg outgoing draft --topic babar
+ comparing with $TESTTMP/draft
+ searching for changes
+ 5 default babar draft C'A
$ hg push draft --topic babar
pushing to $TESTTMP/draft
searching for changes