path: pass `path` to `peer` in largefiles
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 02 Dec 2022 06:42:17 +0100
changeset 49845 8d0a220caee5
parent 49844 0058c74d7f72
child 49846 4dfcdb20ffc7
path: pass `path` to `peer` in largefiles We directly use the `path` object to build the `peer` object.
hgext/largefiles/storefactory.py
--- a/hgext/largefiles/storefactory.py	Fri Dec 02 06:38:03 2022 +0100
+++ b/hgext/largefiles/storefactory.py	Fri Dec 02 06:42:17 2022 +0100
@@ -36,22 +36,23 @@
                 b'lfpullsource', repo, ui, lfpullsource
             )
         else:
-            path, _branches = urlutil.get_unique_pull_path(
-                b'lfpullsource', repo, ui, lfpullsource
+            path = urlutil.get_unique_pull_path_obj(
+                b'lfpullsource', ui, lfpullsource
             )
 
         # XXX we should not explicitly pass b'default', as this will result in
         # b'default' being returned if no `paths.default` was defined. We
         # should explicitely handle the lack of value instead.
         if repo is None:
-            path, _branches = urlutil.get_unique_pull_path(
-                b'lfs', repo, ui, b'default'
+            path = urlutil.get_unique_pull_path_obj(
+                b'lfs',
+                ui,
+                b'default',
             )
             remote = hg.peer(repo or ui, {}, path)
-        elif path == b'default-push' or path == b'default':
+        elif path.loc == b'default-push' or path.loc == b'default':
             remote = repo
         else:
-            path, _branches = urlutil.parseurl(path)
             remote = hg.peer(repo or ui, {}, path)
 
     # The path could be a scheme so use Mercurial's normal functionality