Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 13823:ad179644750f
hg: look up schemes using url.url
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Wed, 30 Mar 2011 20:02:07 -0700 |
parents | 43b5fe18ea6c |
children | ec1695350361 |
comparison
equal
deleted
inserted
replaced
13822:fbf32a6c903e | 13823:ad179644750f |
---|---|
67 'ssh': sshrepo, | 67 'ssh': sshrepo, |
68 'static-http': statichttprepo, | 68 'static-http': statichttprepo, |
69 } | 69 } |
70 | 70 |
71 def _lookup(path): | 71 def _lookup(path): |
72 scheme = 'file' | 72 u = url.url(path) |
73 if path: | 73 scheme = u.scheme or 'file' |
74 c = path.find(':') | |
75 if c > 0: | |
76 scheme = path[:c] | |
77 thing = schemes.get(scheme) or schemes['file'] | 74 thing = schemes.get(scheme) or schemes['file'] |
78 try: | 75 try: |
79 return thing(path) | 76 return thing(path) |
80 except TypeError: | 77 except TypeError: |
81 return thing | 78 return thing |