mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
init: test for git http(s) paths
Wraps the http(s) schemes to test for a .git at the end of the url.
This commit is contained in:
parent
39d59547c5
commit
74ba2fc128
@ -109,6 +109,20 @@ def _local(path):
|
||||
|
||||
hg.schemes['file'] = _local
|
||||
|
||||
def _httpgitwrapper(orig):
|
||||
# we should probably test the connection but for now, we just keep it
|
||||
# simple and check for a url ending in '.git'
|
||||
def httpgitscheme(uri):
|
||||
if uri.endswith('.git'):
|
||||
return gitrepo
|
||||
|
||||
return orig(uri)
|
||||
|
||||
return httpgitscheme
|
||||
|
||||
hg.schemes['https'] = _httpgitwrapper(hg.schemes['https'])
|
||||
hg.schemes['http'] = _httpgitwrapper(hg.schemes['http'])
|
||||
|
||||
hgdefaultdest = hg.defaultdest
|
||||
def defaultdest(source):
|
||||
for scheme in util.gitschemes:
|
||||
|
Loading…
Reference in New Issue
Block a user