diff hgext3rd/topic/flow.py @ 4245:419801742d08

topic: only add --publish flag to push if it's not already there
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 04 Nov 2018 22:06:23 +0800
parents 3675fe74521d
children 35130e428ebd
line wrap: on
line diff
--- a/hgext3rd/topic/flow.py	Mon Nov 05 16:04:01 2018 +0800
+++ b/hgext3rd/topic/flow.py	Sun Nov 04 22:06:23 2018 +0800
@@ -87,8 +87,9 @@
 
 def installpushflag(ui):
     entry = extensions.wrapcommand(commands.table, 'push', wrappush)
-    entry[1].append(('', 'publish', False,
-                    _('push the changeset as public')))
+    if not any(opt for opt in entry[1] if opt[1] == 'publish'): # hg <= 4.9
+        entry[1].append(('', 'publish', False,
+                         _('push the changeset as public')))
     extensions.wrapfunction(exchange.pushoperation, '__init__',
                             extendpushoperation)
     extensions.wrapfunction(exchange, '_pushdiscoveryphase', wrapphasediscovery)