Mercurial > hgsubversion
changeset 1587:4889843a704e
merge old hg fix
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 29 Oct 2018 17:08:38 -0400 |
parents | d6b75cf2c27d (diff) 6cc986fee28e (current diff) |
children | e2d38f6b8afe |
files | hgsubversion/svnrepo.py |
diffstat | 3 files changed, 17 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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')
--- 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 []
--- 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')