changeset 49723:970491e630a5

path: pass `path` to `peer` in `hg identify` We directly use the `path` object to build the `peer` object.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 02 Dec 2022 04:31:08 +0100
parents f4626b74b941
children f3b685d9e899
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Dec 02 03:50:28 2022 +0100
+++ b/mercurial/commands.py	Fri Dec 02 04:31:08 2022 +0100
@@ -3911,12 +3911,11 @@
     peer = None
     try:
         if source:
-            source, branches = urlutil.get_unique_pull_path(
-                b'identify', repo, ui, source
-            )
+            path = urlutil.get_unique_pull_path_obj(b'identify', ui, source)
             # only pass ui when no repo
-            peer = hg.peer(repo or ui, opts, source)
+            peer = hg.peer(repo or ui, opts, path)
             repo = peer.local()
+            branches = (path.branch, [])
             revs, checkout = hg.addbranchrevs(repo, peer, branches, None)
 
         fm = ui.formatter(b'identify', opts)