From patchwork Wed Apr 14 23:38:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10410: transplant: use `get_unique_pull_path` From: phabricator X-Patchwork-Id: 48729 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 14 Apr 2021 23:38:14 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The command does not support multiple destination (yet). REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10410 AFFECTED FILES hgext/infinitepush/__init__.py hgext/transplant.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/hgext/transplant.py b/hgext/transplant.py --- a/hgext/transplant.py +++ b/hgext/transplant.py @@ -47,6 +47,7 @@ from mercurial.utils import ( procutil, stringutil, + urlutil, ) @@ -818,7 +819,8 @@ sourcerepo = opts.get(b'source') if sourcerepo: - peer = hg.peer(repo, opts, ui.expandpath(sourcerepo)) + u = urlutil.get_unique_pull_path(b'transplant', repo, ui, sourcerepo)[0] + peer = hg.peer(repo, opts, u) heads = pycompat.maplist(peer.lookup, opts.get(b'branch', ())) target = set(heads) for r in revs: diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py --- a/hgext/infinitepush/__init__.py +++ b/hgext/infinitepush/__init__.py @@ -684,8 +684,12 @@ def _pull(orig, ui, repo, source=b"default", **opts): opts = pycompat.byteskwargs(opts) # Copy paste from `pull` command - source, branches = urlutil.parseurl( - ui.expandpath(source), opts.get(b'branch') + source, branches = urlutil.get_unique_pull_path( + "infinite-push's pull", + repo, + ui, + source, + default_branches=opts.get(b'branch'), ) scratchbookmarks = {}