On Mon, 09 Apr 2018 00:26:42 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbi...@yahoo.com>
> # Date 1523155211 14400
> #      Sat Apr 07 22:40:11 2018 -0400
> # Node ID f4381233ecb960307d39459ea961a0af03df442b
> # Parent  69ead78af94459ca41e529d0ebfb24bd1d11c32c
> lfs: add the ability to disable the usercache

> +class nullvfs(lfsvfs):
> +    def __init__(self):
> +        pass
> +
> +    def exists(self, oid):
> +        return False
> +
> +    def read(self, oid):
> +        raise IOError('%s: No such file or directory' % self.join(oid))
> +
> +    def walk(self, path=None, onerror=None):
> +        return ('', [], [])
> +
> +    def write(self, oid, data):
> +        pass

I don't think this abstraction would work nicely. For example, local.read()
expects something exists in usercache.

    def read(self, oid, verify=True):
        """Read blob from local blobstore."""
        if not self.vfs.exists(oid):
            blob = self._read(self.cachevfs, oid, verify)
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to