# HG changeset patch # User Augie Fackler # Date 1540847318 14400 # Node ID 4889843a704e7e8e6ccdb161db47fd5b9090fbb7 # Parent d6b75cf2c27d3e261988feabd1360d79380ab8bb# Parent 6cc986fee28ee480a3d7e48d7d1d06941f41269a merge old hg fix diff --git a/hgsubversion/svnrepo.py b/hgsubversion/svnrepo.py --- a/hgsubversion/svnrepo.py +++ b/hgsubversion/svnrepo.py @@ -244,14 +244,20 @@ class svnremoterepo(peerrepository): def debugwireargs(self): raise NotImplementedError -def instance(ui, url, create, intents=None): +def instance(ui, url, create, intents=None, createopts=None): if url.startswith('http://') or url.startswith('https://'): try: # may yield a bogus 'real URL...' message - try: + if createopts: + # intents arg is present is createopts is present + return httppeer.instance(ui, url, create, intents=intents, + createopts=createopts) + elif intents: return httppeer.instance(ui, url, create, intents=intents) - except TypeError: - return httppeer.instance(ui, url, create) # old mercurial versions don'T have that parameter + else: + # intents and createopts not passed, lets be safe and assume + # that mercurial does not know about them + return httppeer.instance(ui, url, create) except error.RepoError: ui.traceback() ui.note('(falling back to Subversion support)\n') diff --git a/hgsubversion/util.py b/hgsubversion/util.py --- a/hgsubversion/util.py +++ b/hgsubversion/util.py @@ -224,8 +224,9 @@ def parseurl(url, heads=[]): class PrefixMatch(object): - def __init__(self, prefix): + def __init__(self, prefix, relativeuipath=True): self.p = prefix + self._relativeuipath = relativeuipath def files(self): return [] diff --git a/tests/test_push_command.py b/tests/test_push_command.py --- a/tests/test_push_command.py +++ b/tests/test_push_command.py @@ -25,6 +25,10 @@ import time revsymbol = test_util.revsymbol +try: + lookuperror = revlog.LookupError +except AttributeError: + lookuperror = hgerror.LookupError class PushTests(test_util.TestBase): obsolete_mode_tests = True @@ -350,7 +354,7 @@ class PushTests(test_util.TestBase): try: self.assertEqual(tip.parents()[0]['adding_file2'].data(), 'foo') assert False, "this is impossible, adding_file2 should not be in this manifest." - except revlog.LookupError, e: + except lookuperror, e: pass self.assertEqual(tip.branch(), 'default')