# HG changeset patch # User Anton Shestakov # Date 1541340383 -28800 # Node ID 419801742d0829183aeb2b0ad09f35e58c4c4317 # Parent 0e266166457fd6203eaa4c63c3c2fbd07a2a844f topic: only add --publish flag to push if it's not already there diff -r 0e266166457f -r 419801742d08 hgext3rd/topic/flow.py --- 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)