Mercurial > hg
comparison mercurial/bookmarks.py @ 22627:808df84fba83
bookmark: make the search for divergent names more robust
We translate the "url we update from" and "the url in the config" into their
canonical representation. This is useful for urls that have multiple equivalent
forms:
/foo/bar/ == file:/foo/bar/ == file:///foo/bar
eg: hg pull --config path.bar=/foo/bar/ file:/foo/bar
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 26 Sep 2014 11:31:15 -0700 |
parents | 5c153c69fdb2 |
children | b3f74b405c20 |
comparison
equal
deleted
inserted
replaced
22626:fb74a5833467 | 22627:808df84fba83 |
---|---|
336 n = '%s@%d' % (b, x) | 336 n = '%s@%d' % (b, x) |
337 if n not in localmarks: | 337 if n not in localmarks: |
338 break | 338 break |
339 # try to use an @pathalias suffix | 339 # try to use an @pathalias suffix |
340 # if an @pathalias already exists, we overwrite (update) it | 340 # if an @pathalias already exists, we overwrite (update) it |
341 path = str(util.url(path)) | |
341 for p, u in ui.configitems("paths"): | 342 for p, u in ui.configitems("paths"): |
343 u = str(util.url(path)) | |
342 if path == u: | 344 if path == u: |
343 n = '%s@%s' % (b, p) | 345 n = '%s@%s' % (b, p) |
344 return n | 346 return n |
345 | 347 |
346 def updatefromremote(ui, repo, remotemarks, path): | 348 def updatefromremote(ui, repo, remotemarks, path): |