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. 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