134 b'custom scheme %s:// conflicts with drive ' |
134 b'custom scheme %s:// conflicts with drive ' |
135 b'letter %s:\\\n' |
135 b'letter %s:\\\n' |
136 ) |
136 ) |
137 % (scheme, scheme.upper()) |
137 % (scheme, scheme.upper()) |
138 ) |
138 ) |
139 hg.schemes[scheme] = ShortRepository(url, scheme, t) |
139 url_scheme = urlutil.url(url).scheme |
|
140 if url_scheme in hg.peer_schemes: |
|
141 hg.peer_schemes[scheme] = ShortRepository(url, scheme, t) |
|
142 else: |
|
143 hg.repo_schemes[scheme] = ShortRepository(url, scheme, t) |
140 |
144 |
141 extensions.wrapfunction(urlutil, b'hasdriveletter', hasdriveletter) |
145 extensions.wrapfunction(urlutil, b'hasdriveletter', hasdriveletter) |
142 |
146 |
143 |
147 |
144 @command(b'debugexpandscheme', norepo=True) |
148 @command(b'debugexpandscheme', norepo=True) |
145 def expandscheme(ui, url, **opts): |
149 def expandscheme(ui, url, **opts): |
146 """given a repo path, provide the scheme-expanded path""" |
150 """given a repo path, provide the scheme-expanded path""" |
147 repo = hg._peerlookup(url) |
151 scheme = urlutil.url(url).scheme |
148 if isinstance(repo, ShortRepository): |
152 if scheme in hg.peer_schemes: |
149 url = repo.resolve(url) |
153 cls = hg.peer_schemes[scheme] |
|
154 else: |
|
155 cls = hg.repo_schemes.get(scheme) |
|
156 if cls is not None and isinstance(cls, ShortRepository): |
|
157 url = cls.resolve(url) |
150 ui.write(url + b'\n') |
158 ui.write(url + b'\n') |