Skip to content
Snippets Groups Projects
Commit 1099f702 authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

schemes: use proper wrapping for `hg.defaultdest()`

parent 9657f906
No related branches found
No related tags found
1 merge request!107Refactor __init__.py to many modules; use exthelper
Pipeline #22251 passed
......@@ -27,7 +27,6 @@
# support for `hg clone localgitrepo`
_oldlocal = hg.schemes[b'file']
hgdefaultdest = hg.defaultdest
def isgitdir(path):
"""True if the given file path is a git repo."""
......@@ -70,8 +69,8 @@
return httpgitscheme
def defaultdest(source):
for scheme in util.gitschemes:
if source.startswith(b'%s://' % scheme) and source.endswith(b'.git'):
return hgdefaultdest(source[:-4])
@eh.wrapfunction(hg, b'defaultdest')
def defaultdest(orig, source):
if source.endswith(b'.git'):
return orig(source[:-4])
......@@ -77,8 +76,5 @@
if source.endswith(b'.git'):
return hgdefaultdest(source[:-4])
return hgdefaultdest(source)
return orig(source)
@eh.wrapfunction(hg, b'peer')
......@@ -119,8 +115,6 @@
hg.schemes[b'http'] = _httpgitwrapper(hg.schemes[b'http'])
hg.schemes[b'file'] = _local
hg.defaultdest = defaultdest
# support for `hg clone git://github.com/defunkt/facebox.git`
# also hg clone git+ssh://git@github.com/schacon/simplegit.git
for _scheme in util.gitschemes:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment