[MERGE] Add VirtualVersionedFiles class.

Ian Clatworthy ian.clatworthy at canonical.com
Thu Jul 17 09:00:22 BST 2008


Jelmer Vernooij wrote:

> This class implements the read-only bits of the VersionedFiles API without
> using a matching file format, instead relying on specified functions to 
> retrieve the full texts and parent maps.

Sorry to take so long to get to reviewing this.

bb:tweak

> +    def test_get_sha1s_nonexistant(self):
> +        self.assertEquals({}, self.texts.get_sha1s([("NONEXISTANT",)]))

The correct spelling is actually "non-existent" so it would be nice
to replace the aA with eE here.

> +    def get_parent_map(self, keys):
> +        """See VersionedFiles.get_parent_map."""
> +        return dict([((k,), tuple([(p,) for p in v])) for k,v in self._get_parent_map([k for (k,) in keys]).iteritems()])
> +

Need to wrap this long line before column 80.

> +            if lines is not None:
> +                assert isinstance(lines, list)

We don't support asserts in the code any more. Please replace this
with "if ...: AssertionError(...)".

> +            lines = self._get_lines(k)
> +            if lines is not None:
> +                assert isinstance(lines, list)

Ditto.

Ian C.



More information about the bazaar mailing list