# HG changeset patch # User Pierre-Yves David # Date 2021-04-16 00:14:21 # Node ID 353718f741a87435f02d499ffb13a4f12dc5c23b # Parent 7531cc34713c6d055ad18e697344b8a9fe9be8a5 bookmark: use `list_paths` to access path definition The content of the `[paths]` config section is receiving transformation that make it hard to recognise whats the actual name, and the next changeset will make it worse. So we use the official API for this instead. Differential Revision: https://phab.mercurial-scm.org/D10448 diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -600,11 +600,12 @@ def _diverge(ui, b, path, localmarks, re # if an @pathalias already exists, we overwrite (update) it if path.startswith(b"file:"): path = urlutil.url(path).path - for p, u in ui.configitems(b"paths"): - if u.startswith(b"file:"): - u = urlutil.url(u).path - if path == u: - return b'%s@%s' % (b, p) + for name, p in urlutil.list_paths(ui): + loc = p.rawloc + if loc.startswith(b"file:"): + loc = urlutil.url(loc).path + if path == loc: + return b'%s@%s' % (b, name) # assign a unique "@number" suffix newly for x in range(1, 100):