##// END OF EJS Templates
relink: use `get_unique_pull_path`...
marmoute -
r47704:b5e7cdb9 default
parent child Browse files
Show More
@@ -19,7 +19,10 b' from mercurial import ('
19 19 registrar,
20 20 util,
21 21 )
22 from mercurial.utils import stringutil
22 from mercurial.utils import (
23 stringutil,
24 urlutil,
25 )
23 26
24 27 cmdtable = {}
25 28 command = registrar.command(cmdtable)
@@ -62,10 +65,11 b' def relink(ui, repo, origin=None, **opts'
62 65 util, b'samedevice'
63 66 ):
64 67 raise error.Abort(_(b'hardlinks are not supported on this system'))
65 src = hg.repository(
66 repo.baseui,
67 ui.expandpath(origin or b'default-relink', origin or b'default'),
68 )
68
69 if origin is None and b'default-relink' in ui.paths:
70 origin = b'default-relink'
71 path, __ = urlutil.get_unique_pull_path(b'relink', repo, ui, origin)
72 src = hg.repository(repo.baseui, path)
69 73 ui.status(_(b'relinking %s to %s\n') % (src.store.path, repo.store.path))
70 74 if repo.root == src.root:
71 75 ui.status(_(b'there is nothing to relink\n'))
General Comments 0
You need to be logged in to leave comments. Login now