--- a/hgext3rd/topic/flow.py Mon Dec 24 17:47:28 2018 +0100
+++ b/hgext3rd/topic/flow.py Tue Jan 22 12:54:44 2019 -0500
@@ -7,7 +7,6 @@
extensions,
node,
phases,
- util,
)
from mercurial.i18n import _
@@ -75,9 +74,6 @@
def wrapphasediscovery(orig, pushop):
orig(pushop)
if getattr(pushop, 'publish', False):
- if not util.safehasattr(pushop, 'remotephases'):
- msg = _('--publish flag only supported from Mercurial 4.4 and higher')
- raise error.Abort(msg)
if not pushop.remotephases.publishing:
unfi = pushop.repo.unfiltered()
droots = pushop.remotephases.draftroots
@@ -87,8 +83,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)