[RFC] weave refactoring
Martin Pool
mbp at sourcefrog.net
Mon Dec 12 08:01:54 GMT 2005
On 11 Dec 2005, Johan Rydberg <jrydberg at gnu.org> wrote:
> Hi,
>
> In my efforts to implement the knit history format I've begun a
> refactoring work of things in bzrlib that operates on versioned files;
> i.e., weaves. I've created an abstract class called VersionedFile,
> and a store type to come with it; VersionedFileStore.
>
> I renamed control_weaves to control_store, and weave_store to
> file_store. revision_store is left untouched at this moment.
>
> To test the concept I implemented WeaveVersionedFile, and changed
> WeaveStore to implement the VersionedFileStore API. It took some
> effort, but _almost_* all tests pass. There is also some code that is
> hard to adopt to the new API; the weave merge being one. Right now it
> knows about the internals of WeaveVersionedFile.
>
> The code can be found at:
>
> http://repo.panadafs.org/bzr/bzr.jrydberg.versionedfile/
This looks like a very good direction to me.
Weave could almost implement VersionedFile directly, but perhaps it's
better to keep just the datastructure in Weave and coordinate with the
store in WeaveVersionedFile.
I think I'd handle weave merge like this: ask the VersionedFile for its
representation as a Weave. (Like asking it for that interface). Allow
this to raise an exception if the file is stored in a way that's not
either a weave or convertible to a weave; this should terminate the
merge.
For upgrades: the code that's currently in upgrade is really for a
specific type of upgrade to a particular version. There should be tests
that it still works so that we can write out previous formats but you
can use different upgrade code to go to a new format.
--
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051212/37eb1613/attachment.pgp
More information about the bazaar
mailing list