443 raise error.Abort(_('detected corrupt lfs object: %s') % oid, |
443 raise error.Abort(_('detected corrupt lfs object: %s') % oid, |
444 hint=_('run hg verify')) |
444 hint=_('run hg verify')) |
445 |
445 |
446 def remote(repo): |
446 def remote(repo): |
447 """remotestore factory. return a store in _storemap depending on config""" |
447 """remotestore factory. return a store in _storemap depending on config""" |
448 defaulturl = '' |
448 url = util.url(repo.ui.config('lfs', 'url') or '') |
449 |
|
450 # convert deprecated configs to the new url. TODO: remove this if other |
|
451 # places are migrated to the new url config. |
|
452 # deprecated config: lfs.remotestore |
|
453 deprecatedstore = repo.ui.config('lfs', 'remotestore') |
|
454 if deprecatedstore == 'dummy': |
|
455 # deprecated config: lfs.remotepath |
|
456 defaulturl = 'file://' + repo.ui.config('lfs', 'remotepath') |
|
457 elif deprecatedstore == 'git-lfs': |
|
458 # deprecated config: lfs.remoteurl |
|
459 defaulturl = repo.ui.config('lfs', 'remoteurl') |
|
460 elif deprecatedstore == 'null': |
|
461 defaulturl = 'null://' |
|
462 |
|
463 url = util.url(repo.ui.config('lfs', 'url', defaulturl)) |
|
464 scheme = url.scheme |
449 scheme = url.scheme |
465 if scheme not in _storemap: |
450 if scheme not in _storemap: |
466 raise error.Abort(_('lfs: unknown url scheme: %s') % scheme) |
451 raise error.Abort(_('lfs: unknown url scheme: %s') % scheme) |
467 return _storemap[scheme](repo, url) |
452 return _storemap[scheme](repo, url) |
468 |
453 |