Unified · Split
| @@ -106,18 +106,6 @@ for _scheme in util.gitschemes: · 105 unmodified lines | ||
| 106 | 106 | # support for `hg clone localgitrepo` |
| 107 | 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 | 109 | def _isgitdir(path): |
| 122 | 110 | """True if the given file path is a git repo.""" |
| 123 | 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 | 127 | def _local(path): |
| 140 | − p = urlcls(path).localpath() | |
| 128 | + p = hgutil.url(path).localpath() | |
| 141 | 129 | if _isgitdir(p): |
| 142 | 130 | return gitrepo |
| 143 | 131 | # detect git ssh urls (which mercurial thinks is a file-like path) |