comparison mercurial/debugcommands.py @ 46961:d7b36a4e03de

debugbackupbundle: use `get_unique_pull_path` This is the last known user of `ui.expandpath` outside of `urlutil`. Hooray. Differential Revision: https://phab.mercurial-scm.org/D10428
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 14 Apr 2021 21:15:53 +0200
parents 69359c91dc43
children d55b71393907 bd2ed1032b4e
comparison
equal deleted inserted replaced
46960:69359c91dc43 46961:d7b36a4e03de
3763 ui.status(_(b"no backup changesets found\n")) 3763 ui.status(_(b"no backup changesets found\n"))
3764 return 3764 return
3765 3765
3766 for backup in backups: 3766 for backup in backups:
3767 # Much of this is copied from the hg incoming logic 3767 # Much of this is copied from the hg incoming logic
3768 source = ui.expandpath(os.path.relpath(backup, encoding.getcwd())) 3768 source = os.path.relpath(backup, encoding.getcwd())
3769 source, branches = urlutil.parseurl(source, opts.get(b"branch")) 3769 source, branches = urlutil.get_unique_pull_path(
3770 b'debugbackupbundle',
3771 repo,
3772 ui,
3773 source,
3774 default_branches=opts.get(b'branch'),
3775 )
3770 try: 3776 try:
3771 other = hg.peer(repo, opts, source) 3777 other = hg.peer(repo, opts, source)
3772 except error.LookupError as ex: 3778 except error.LookupError as ex:
3773 msg = _(b"\nwarning: unable to open bundle %s") % source 3779 msg = _(b"\nwarning: unable to open bundle %s") % source
3774 hint = _(b"\n(missing parent rev %s)\n") % short(ex.name) 3780 hint = _(b"\n(missing parent rev %s)\n") % short(ex.name)