# HG changeset patch # User Augie Fackler # Date 1462935710 14400 # Node ID 963946d7dfd780326468bf0855dffb8b63a8ab75 # Parent ae4bdba90e7b8a651b734a346fdff58fe8d161f7 externals: update for Mercurial 3.8's new subrepo API diff --git a/hgsubversion/svnexternals.py b/hgsubversion/svnexternals.py --- a/hgsubversion/svnexternals.py +++ b/hgsubversion/svnexternals.py @@ -386,10 +386,17 @@ def parse(ui, ctx): raise hgutil.Abort(_('unknown externals modes: %s') % mode) return external +_notset = object() + class svnsubrepo(subrepo.svnsubrepo): - def __init__(self, ctx, path, state): + def __init__(self, ctx, path, state, allowcreate=_notset): state = (state[0].split(':', 1)[1], state[1]) - super(svnsubrepo, self).__init__(ctx, path, state) + if allowcreate is _notset: + # Mercurial 3.7 and earlier + super(svnsubrepo, self).__init__(ctx, path, state) + else: + # Mercurial 3.8 and later + super(svnsubrepo, self).__init__(ctx, path, state, allowcreate) # Mercurial 3.3+ set 'ui' rather than '_ui' -- set that and use 'ui' # everywhere to maintain compatibility across versions if not hgutil.safehasattr(self, 'ui'):