##// END OF EJS Templates
path: error out if the `path://` reference point to an unknown path...
marmoute -
r47584:395cf404 default
parent child Browse files
Show More
@@ -2339,7 +2339,12 b' class path(object):'
2339 2339 def chain_path(self, ui, paths):
2340 2340 if self.url.scheme == b'path':
2341 2341 assert self.url.path is None
2342 subpath = paths[self.url.host]
2342 try:
2343 subpath = paths[self.url.host]
2344 except KeyError:
2345 m = _('cannot use `%s`, "%s" is not a known path')
2346 m %= (self.rawloc, self.url.host)
2347 raise error.Abort(m)
2343 2348 if subpath.raw_url.scheme == b'path':
2344 2349 m = _('cannot use `%s`, "%s" is also define as a `path://`')
2345 2350 m %= (self.rawloc, self.url.host)
@@ -370,3 +370,18 b' Doing an actual circle should always be '
370 370 $ hg pull chain_path
371 371 abort: cannot use `path://other_default`, "other_default" is also define as a `path://`
372 372 [255]
373
374 Test basic error cases
375 ----------------------
376
377 $ cat << EOF > .hg/hgrc
378 > [paths]
379 > error-missing=path://unknown
380 > EOF
381 $ hg path
382 abort: cannot use `path://unknown`, "unknown" is not a known path
383 [255]
384 $ hg pull error-missing
385 abort: cannot use `path://unknown`, "unknown" is not a known path
386 [255]
387
General Comments 0
You need to be logged in to leave comments. Login now