Patchwork D10438: urlutil: inline the relevant part of `getpath` in `get_push_paths`

login
register
mail settings
Submitter phabricator
Date April 15, 2021, 8:52 a.m.
Message ID <differential-rev-PHID-DREV-vsv7uqgli5mewno3fwr2-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48754/
State Superseded
Headers show

Comments

phabricator - April 15, 2021, 8:52 a.m.
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




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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=()):