Patchwork D10422: revset: use `get_unique_pull_path` for `remote(…)`

login
register
mail settings
Submitter phabricator
Date April 14, 2021, 11:41 p.m.
Message ID <differential-rev-PHID-DREV-xsuwmq5lduxvv4w2dyqt-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48738/
State Superseded
Headers show

Comments

phabricator - April 14, 2021, 11:41 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This one is also resolving path. For now we restrict the feature to a single
  destination. This might change in the future.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10422

AFFECTED FILES
  mercurial/revset.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2121,8 +2121,11 @@ 
     if len(l) > 1:
         # i18n: "remote" is a keyword
         dest = getstring(l[1], _(b"remote requires a repository path"))
-    dest = repo.ui.expandpath(dest or b'default')
-    dest, branches = urlutil.parseurl(dest)
+    if not dest:
+        dest = b'default'
+    dest, branches = urlutil.get_unique_pull_path(
+        b'remote', repo, repo.ui, dest
+    )
 
     other = hg.peer(repo, {}, dest)
     n = other.lookup(q)