Read about our upcoming Code of Conduct on this issue

Commit 5a93cb41 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

topic: substitute current topic when `--topic .` is used for outgoing/push

This special case is similar to `hg outgoing/push -B .`, where currently active
bookmark is used instead of `.`.
parent 35e7c6f6d6dc
Pipeline #7647 passed with stage
in 4 minutes and 6 seconds
......@@ -9,6 +9,7 @@ topic (0.20.0)
* stack: support foo#stack relation revset (hg-5.4+ only)
* topic: hg push --topic does-not-exist now doesn't try to push unrelated
changesets and aborts instead
* topic: hg outgoing/push --topic . will use current topic
10.0.0 -- 2020-05-09
--------------------
......
......@@ -1269,7 +1269,10 @@ def committextwrap(orig, repo, ctx, subs, extramsg):
def pushoutgoingwrap(orig, ui, repo, *args, **opts):
if opts.get('topic'):
topic = b'literal:' + opts['topic']
topic = opts['topic']
if topic == b'.':
topic = repo.currenttopic
topic = b'literal:' + topic
topicrevs = repo.revs(b'topic(%s) - obsolete()', topic)
opts.setdefault('rev', []).extend(topicrevs)
return orig(ui, repo, *args, **opts)
......
......@@ -216,6 +216,14 @@ push --topic
abort: topic 'nonexistent' does not exist!
[255]
$ hg up babar
switching to topic babar
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg outgoing draft --topic .
comparing with $TESTTMP/draft
searching for changes
5 default babar draft C'A
$ hg outgoing draft --topic babar
comparing with $TESTTMP/draft
searching for changes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment