hgext/lfs/blobstore.py
changeset 37564 31a4ea773369
parent 37563 be1cc65bdb1c
child 37565 9c7a25ef5b49
--- a/hgext/lfs/blobstore.py	Sun Apr 08 01:23:39 2018 -0400
+++ b/hgext/lfs/blobstore.py	Sun Apr 08 14:22:12 2018 -0400
@@ -529,7 +529,7 @@
         raise error.Abort(_('detected corrupt lfs object: %s') % oid,
                           hint=_('run hg verify'))
 
-def remote(repo):
+def remote(repo, remote=None):
     """remotestore factory. return a store in _storemap depending on config
 
     If ``lfs.url`` is specified, use that remote endpoint.  Otherwise, try to
@@ -541,7 +541,9 @@
     """
     url = util.url(repo.ui.config('lfs', 'url') or '')
     if url.scheme is None:
-        if util.safehasattr(repo, '_subtoppath'):
+        if remote:
+            defaulturl = util.url(remote)
+        elif util.safehasattr(repo, '_subtoppath'):
             # The pull command sets this during the optional update phase, which
             # tells exactly where the pull originated, whether 'paths.default'
             # or explicit.