diff mercurial/debugcommands.py @ 46908:4452cb788404

urlutil: extract `parseurl` from `hg` into the new module The new module is well fitting for this new code. And this will be useful to make the gathered code collaborate more later. Differential Revision: https://phab.mercurial-scm.org/D10375
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 12 Apr 2021 06:34:54 +0200
parents ffd3e823a7e5
children 9e021cffb356
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Mon Apr 12 03:01:04 2021 +0200
+++ b/mercurial/debugcommands.py	Mon Apr 12 06:34:54 2021 +0200
@@ -1060,7 +1060,7 @@
 
     if not remote_revs:
 
-        remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl))
+        remoteurl, branches = urlutil.parseurl(ui.expandpath(remoteurl))
         remote = hg.peer(repo, opts, remoteurl)
         ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(remoteurl))
     else:
@@ -3652,7 +3652,7 @@
             )
         source = b"default"
 
-    source, branches = hg.parseurl(ui.expandpath(source))
+    source, branches = urlutil.parseurl(ui.expandpath(source))
     url = urlutil.url(source)
 
     defaultport = {b'https': 443, b'ssh': 22}
@@ -3762,7 +3762,7 @@
     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 = hg.parseurl(source, opts.get(b"branch"))
+        source, branches = urlutil.parseurl(source, opts.get(b"branch"))
         try:
             other = hg.peer(repo, opts, source)
         except error.LookupError as ex: