D10438: urlutil: inline the relevant part of `getpath` in `get_push_paths`
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Thu Apr 15 08:52:56 UTC 2021
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
The part that `get_push_paths` needs is quite simple, inclining will help us
to deprecated `getpath`.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D10438
AFFECTED FILES
mercurial/utils/urlutil.py
CHANGE DETAILS
diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py
--- a/mercurial/utils/urlutil.py
+++ b/mercurial/utils/urlutil.py
@@ -471,7 +471,15 @@
)
else:
for dest in dests:
- yield ui.getpath(dest)
+ if dest in ui.paths:
+ yield ui.paths[dest]
+ else:
+ path = try_path(ui, dest)
+ if path is None:
+ msg = _(b'repository %s does not exist')
+ msg %= dest
+ raise error.RepoError(msg)
+ yield path
def get_pull_paths(repo, ui, sources, default_branches=()):
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list