John Arbash Meinel
john at arbash-meinel.com
Fri Jul 18 21:04:23 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
To make progress towards updating merge to handle criss-cross a bit
better, I've written a helper class.
The basic idea is that I'm going to be switching from 3-way merge logic
for inventory information, into more of an LCA-style logic.
The first step in that, is to determine what is new in THIS versus *all*
the LCAs. And I was planning on doing that by using last-modified info
as a first culling pass, and then look closer (either using LCA logic,
or using per-file graphs and loading the different inventories.)
Anyway, this code drop is intended to bring in a class that can walk
multiple trees at the same time, and yield the matching inventory
entries against all trees.
It is technically a 'merge_sort' across the iter_entries_by_dir on each
tree. Though I cheat a little bit, by knowing that I can do direct
lookups, in case something was renamed on one side.
I also use a single "master" entry, and then fill in the rest later. So
it isn't a pure "merge sort". It might be better to do that, but this
was easier for me to code.
It isn't in active use yet, but it is something that can be reviewed
And one bit that isn't as thoroughly tested as I would like. The paths
need to be compared in "dirblock" sorted order (otherwise you would end
up with iterators out of sync). I just had difficulty writing up a
correct patch that would fail if you didn't use the right ordering.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar