[RFC] two-phase version add?
Martin Pool
mbp at sourcefrog.net
Tue Jun 26 01:36:48 BST 2007
On 6/26/07, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> I think it would be preferable to implement two-phase version adds, so
> that we could write the revision and inventory at the beginning of the
> bundle, then the files, then activate the inventory, then activate the
> revision.
Yes, I see what you mean. I guess this would have to be exposed at
the Repository level. In terms of storage we could write them into
the knit files and remember what regions were written, but just not
add them to the index until we successfully complete. If we fail we
could either truncate the data file, or just leave it there as
unreachable junk.
The heart of this is that we overload "revision text is visible in the
repository" with "revision tree is totally reconstructable from the
repository". If we didn't need to maintain that, we could just write
in the revision, inventory and files in whatever order they arrive.
That property does make some things easier, but it confines us in this
way and it might be a problem for eg shallow branches wanting revision
summaries but not details? Perhaps we should, at least, be more
explicit about this - eg adding a repository method that asks whether
a revision is totally present, even if it just falls back to checking
if the revision is there. But on the whole I think it's a reasonable
invariant.
--
Martin
More information about the bazaar
mailing list