comparison hgext/transplant.py @ 46944:0428e555acb7

transplant: use `get_unique_pull_path` The command does not support multiple destination (yet). Differential Revision: https://phab.mercurial-scm.org/D10410
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 16 Apr 2021 10:46:56 +0200
parents 59fa3890d40a
children d55b71393907
comparison
equal deleted inserted replaced
46943:30ee1224b9a2 46944:0428e555acb7
45 vfs as vfsmod, 45 vfs as vfsmod,
46 ) 46 )
47 from mercurial.utils import ( 47 from mercurial.utils import (
48 procutil, 48 procutil,
49 stringutil, 49 stringutil,
50 urlutil,
50 ) 51 )
51 52
52 53
53 class TransplantError(error.Abort): 54 class TransplantError(error.Abort):
54 pass 55 pass
816 cmdutil.checkunfinished(repo) 817 cmdutil.checkunfinished(repo)
817 cmdutil.bailifchanged(repo) 818 cmdutil.bailifchanged(repo)
818 819
819 sourcerepo = opts.get(b'source') 820 sourcerepo = opts.get(b'source')
820 if sourcerepo: 821 if sourcerepo:
821 peer = hg.peer(repo, opts, ui.expandpath(sourcerepo)) 822 u = urlutil.get_unique_pull_path(b'transplant', repo, ui, sourcerepo)[0]
823 peer = hg.peer(repo, opts, u)
822 heads = pycompat.maplist(peer.lookup, opts.get(b'branch', ())) 824 heads = pycompat.maplist(peer.lookup, opts.get(b'branch', ()))
823 target = set(heads) 825 target = set(heads)
824 for r in revs: 826 for r in revs:
825 try: 827 try:
826 target.add(peer.lookup(r)) 828 target.add(peer.lookup(r))