path: pass `path` to `peer` in `hg identify`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 02 Dec 2022 04:31:08 +0100
changeset 49835 970491e630a5
parent 49834 f4626b74b941
child 49836 f3b685d9e899
path: pass `path` to `peer` in `hg identify` We directly use the `path` object to build the `peer` object.
mercurial/commands.py
--- 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)