changeset 1407:963946d7dfd7 stable

externals: update for Mercurial 3.8's new subrepo API
author Augie Fackler <raf@durin42.com>
date Tue, 10 May 2016 23:01:50 -0400
parents ae4bdba90e7b
children 49d324e11856
files hgsubversion/svnexternals.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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'):