Unified · Split
| @@ -106,18 +106,6 @@ for _scheme in util.gitschemes: · 105 unmodified lines | |||
| 106 | # support for `hg clone localgitrepo` | 106 | # support for `hg clone localgitrepo` |
| 107 | _oldlocal = hg.schemes['file'] | 107 | _oldlocal = hg.schemes['file'] |
| 108 | 108 | ||
| 109 | # COMPAT: hg 1.9 - url.url class moved into util module | ||
| 110 | try: | ||
| 111 | urlcls = hgutil.url | ||
| 112 | except AttributeError: | ||
| 113 | class urlcls(object): | ||
| 114 | def __init__(self, path): | ||
| 115 | self.p = hgutil.drop_scheme('file', path) | ||
| 116 | |||
| 117 | def localpath(self): | ||
| 118 | return self.p | ||
| 119 | |||
| 120 | |||
| 121 | def _isgitdir(path): | 109 | def _isgitdir(path): |
| 122 | """True if the given file path is a git repo.""" | 110 | """True if the given file path is a git repo.""" |
| 123 | if os.path.exists(os.path.join(path, '.hg')): | 111 | if os.path.exists(os.path.join(path, '.hg')): |
| @@ -137,7 +125,7 @@ def _isgitdir(path): · 13 unmodified lines | |||
| 137 | 125 | ||
| 138 | 126 | ||
| 139 | def _local(path): | 127 | def _local(path): |
| 140 | p = urlcls(path).localpath() | 128 | p = hgutil.url(path).localpath() |
| 141 | if _isgitdir(p): | 129 | if _isgitdir(p): |
| 142 | return gitrepo | 130 | return gitrepo |
| 143 | # detect git ssh urls (which mercurial thinks is a file-like path) | 131 | # detect git ssh urls (which mercurial thinks is a file-like path) |