# HG changeset patch # User Denis Laxalde # Date 1506080801 -7200 # Node ID c0de0010ec30f1cdb890fb69a260c63cf9142538 # Parent fef934b7ed86b848bd0b9c506632d2aa83d61b25 topic: add a --topic option to "outgoing" command By symmetry with "push" in the previous changeset. diff -r fef934b7ed86 -r c0de0010ec30 hgext3rd/topic/__init__.py --- 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) diff -r fef934b7ed86 -r c0de0010ec30 tests/test-topic-push.t --- 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