[Updated] D10392: incoming: use `urlutil.get_pull_paths`

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Thu Apr 15 13:46:18 UTC 2021


Closed by commit rHGdec31caf5fd6: incoming: use `urlutil.get_pull_paths` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10392?vs=26914&id=26934

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10392/new/

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/hg.py

CHANGE DETAILS

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -1263,9 +1263,13 @@
         (remoterepo, incomingchangesetlist, displayer) parameters,
     and is supposed to contain only code that can't be unified.
     """
-    source, branches = urlutil.parseurl(
-        ui.expandpath(source), opts.get(b'branch')
-    )
+    srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch'))
+    srcs = list(srcs)
+    if len(srcs) != 1:
+        msg = _('for now, incoming supports only a single source, %d provided')
+        msg %= len(srcs)
+        raise error.Abort(msg)
+    source, branches = srcs[0]
     other = peer(repo, opts, source)
     cleanupfn = other.close
     try:
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4311,19 +4311,20 @@
     cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle'])
 
     if opts.get(b'bookmarks'):
-        source, branches = urlutil.parseurl(
-            ui.expandpath(source), opts.get(b'branch')
-        )
-        other = hg.peer(repo, opts, source)
-        try:
-            if b'bookmarks' not in other.listkeys(b'namespaces'):
-                ui.warn(_(b"remote doesn't support bookmarks\n"))
-                return 0
-            ui.pager(b'incoming')
-            ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(source))
-            return bookmarks.incoming(ui, repo, other)
-        finally:
-            other.close()
+        srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch'))
+        for source, branches in srcs:
+            other = hg.peer(repo, opts, source)
+            try:
+                if b'bookmarks' not in other.listkeys(b'namespaces'):
+                    ui.warn(_(b"remote doesn't support bookmarks\n"))
+                    return 0
+                ui.pager(b'incoming')
+                ui.status(
+                    _(b'comparing with %s\n') % urlutil.hidepassword(source)
+                )
+                return bookmarks.incoming(ui, repo, other)
+            finally:
+                other.close()
 
     repo._subtoppath = ui.expandpath(source)
     try:



To: marmoute, #hg-reviewers, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210415/4fc9f882/attachment-0002.html>


More information about the Mercurial-patches mailing list