diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py --- a/hgext/lfs/__init__.py +++ b/hgext/lfs/__init__.py @@ -174,6 +174,9 @@ configitem('experimental', 'lfs.serve', configitem('experimental', 'lfs.user-agent', default=None, ) +configitem('experimental', 'lfs.disableusercache', + default=False, +) configitem('experimental', 'lfs.worker-enable', default=False, ) diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py --- a/hgext/lfs/blobstore.py +++ b/hgext/lfs/blobstore.py @@ -118,14 +118,12 @@ class local(object): def __init__(self, repo): fullpath = repo.svfs.join('lfs/objects') self.vfs = lfsvfs(fullpath) - usercache = util.url(lfutil._usercachedir(repo.ui, 'lfs')) - if usercache.scheme in (None, 'file'): - self.cachevfs = lfsvfs(usercache.localpath()) - elif usercache.scheme == 'null': + + if repo.ui.configbool('experimental', 'lfs.disableusercache'): self.cachevfs = nullvfs() else: - raise error.Abort(_('unknown lfs cache scheme: %s') - % usercache.scheme) + usercache = lfutil._usercachedir(repo.ui, 'lfs') + self.cachevfs = lfsvfs(usercache) self.ui = repo.ui def open(self, oid): diff --git a/tests/test-lfs-serve.t b/tests/test-lfs-serve.t --- a/tests/test-lfs-serve.t +++ b/tests/test-lfs-serve.t @@ -33,8 +33,9 @@ side. If that *is* enabled, the subsequ for flag '0x2000'!" if the extension is only loaded on one side (possibly also masked by the Internal Server Error message). $ cat >> $HGRCPATH < [experimental] + > lfs.disableusercache = True > [lfs] - > usercache = null:// > threshold=10 > [web] > allow_push=*