Patchwork D10428: debugbackupbundle: use `get_unique_pull_path`

login
register
mail settings
Submitter phabricator
Date April 14, 2021, 11:41 p.m.
Message ID <differential-rev-PHID-DREV-tozhpk4klscx6vo7fqmt-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48749/
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 is the last known user of `ui.expandpath` outside of `urlutil`. Hooray.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -3765,8 +3765,14 @@ 
 
     for backup in backups:
         # Much of this is copied from the hg incoming logic
-        source = ui.expandpath(os.path.relpath(backup, encoding.getcwd()))
-        source, branches = urlutil.parseurl(source, opts.get(b"branch"))
+        source = os.path.relpath(backup, encoding.getcwd())
+        source, branches = urlutil.get_unique_pull_path(
+            b'debugbackupbundle',
+            repo,
+            ui,
+            source,
+            default_branches=opts.get(b'branch'),
+        )
         try:
             other = hg.peer(repo, opts, source)
         except error.LookupError as ex: