diff hgext3rd/topic/__init__.py @ 5380:60317988f5ae

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 `.`.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 12 Jun 2020 15:42:43 +0800
parents bed4fc158fc9
children fb543438704b
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Thu Jun 11 23:38:55 2020 +0800
+++ b/hgext3rd/topic/__init__.py	Fri Jun 12 15:42:43 2020 +0800
@@ -1269,7 +1269,10 @@
 
 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)