##// END OF EJS Templates
lfs: use the new APIs...
marmoute -
r47709:3f29765e default
parent child Browse files
Show More
@@ -22,6 +22,7 b' from . import ('
22 22 wirestore,
23 23 )
24 24
25
25 26 # During clone this function is passed the src's ui object
26 27 # but it needs the dest's ui object so it can read out of
27 28 # the config file. Use repo.ui instead.
@@ -31,19 +32,22 b' def openstore(repo=None, remote=None, pu'
31 32
32 33 if not remote:
33 34 lfpullsource = getattr(repo, 'lfpullsource', None)
34 if lfpullsource:
35 path = ui.expandpath(lfpullsource)
36 elif put:
37 path = ui.expandpath(b'default-push', b'default')
35 if put:
36 path = urlutil.get_unique_push_path(
37 b'lfpullsource', repo, ui, lfpullsource
38 )
38 39 else:
39 path = ui.expandpath(b'default')
40 path, _branches = urlutil.get_unique_pull_path(
41 b'lfpullsource', repo, ui, lfpullsource
42 )
40 43
41 # ui.expandpath() leaves 'default-push' and 'default' alone if
42 # they cannot be expanded: fallback to the empty string,
43 # meaning the current directory.
44 # XXX we should not explicitly pass b'default', as this will result in
45 # b'default' being returned if no `paths.default` was defined. We
46 # should explicitely handle the lack of value instead.
44 47 if repo is None:
45 path = ui.expandpath(b'default')
46 path, _branches = urlutil.parseurl(path)
48 path, _branches = urlutil.get_unique_pull_path(
49 b'lfs', repo, ui, b'default'
50 )
47 51 remote = hg.peer(repo or ui, {}, path)
48 52 elif path == b'default-push' or path == b'default':
49 53 remote = repo
General Comments 0
You need to be logged in to leave comments. Login now