Mercurial > hgsubversion
changeset 1583:f778fdd82c83
svnrepo: preserve and forward createopts kwarg
This patch adds some if-elses to make sure we don't pass intent or createopts to
a httppeer.instance() which does not know about that i.e. we don't pass them
when hg is old.
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Wed, 24 Oct 2018 15:18:55 +0300 |
parents | e15dc9e9cd56 |
children | 2b342625a92a |
files | hgsubversion/svnrepo.py |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgsubversion/svnrepo.py +++ b/hgsubversion/svnrepo.py @@ -244,11 +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 - return httppeer.instance(ui, url, create, intents=intents) + 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) + 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')