[Updated] D10413: lfs: use the new APIs
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Sat Apr 17 22:11:27 UTC 2021
Closed by commit rHG3f29765e0d95: lfs: use the new APIs (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/D10413?vs=26916&id=26979
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10413/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10413
AFFECTED FILES
hgext/largefiles/storefactory.py
CHANGE DETAILS
diff --git a/hgext/largefiles/storefactory.py b/hgext/largefiles/storefactory.py
--- a/hgext/largefiles/storefactory.py
+++ b/hgext/largefiles/storefactory.py
@@ -22,6 +22,7 @@
wirestore,
)
+
# During clone this function is passed the src's ui object
# but it needs the dest's ui object so it can read out of
# the config file. Use repo.ui instead.
@@ -31,19 +32,22 @@
if not remote:
lfpullsource = getattr(repo, 'lfpullsource', None)
- if lfpullsource:
- path = ui.expandpath(lfpullsource)
- elif put:
- path = ui.expandpath(b'default-push', b'default')
+ if put:
+ path = urlutil.get_unique_push_path(
+ b'lfpullsource', repo, ui, lfpullsource
+ )
else:
- path = ui.expandpath(b'default')
+ path, _branches = urlutil.get_unique_pull_path(
+ b'lfpullsource', repo, ui, lfpullsource
+ )
- # ui.expandpath() leaves 'default-push' and 'default' alone if
- # they cannot be expanded: fallback to the empty string,
- # meaning the current directory.
+ # 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 = ui.expandpath(b'default')
- path, _branches = urlutil.parseurl(path)
+ path, _branches = urlutil.get_unique_pull_path(
+ b'lfs', repo, ui, b'default'
+ )
remote = hg.peer(repo or ui, {}, path)
elif path == b'default-push' or path == b'default':
remote = repo
To: marmoute, #hg-reviewers, pulkit
Cc: mharbison72, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210417/6e59fd5b/attachment-0002.html>
More information about the Mercurial-patches
mailing list