changeset 49845:8d0a220caee5

path: pass `path` to `peer` in largefiles 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 06:42:17 +0100
parents 0058c74d7f72
children 4dfcdb20ffc7
files hgext/largefiles/storefactory.py
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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