please check out weave-format branch

Martin Pool martinpool at gmail.com
Fri Sep 23 07:46:27 BST 2005


On 23/09/05, John Arbash Meinel <john at arbash-meinel.com> wrote:

> 4) What is supposed to be in "ancestry.weave"? How does it work when you
> do a merge? In looking through the file, it looks like each revision
> adds only one new entry, shouldn't some of them add 2? If I understand
> the idea, you are trying to have a file which can be queried to get the
> complete ancestry for a given revision. But I don't see how it handles
> branching.

Version R of the ancestry file contains a list of every revision
merged into R plus R, ordered so that parents come before their
children.

Straight-line commits therefore add just a single line, being their
own revision id.

When you do a merge, the ancestry of the merged revision will be the
set union (preserving order) of the merged parents.

It handles branching because weaves can hold a branched DAG of
revisions within them.  (Run "weave.py toc ancestry.weave" to see it.)

The ancestry list is interesting in for several algorithms.  If we
calculate the set intersection of the ancestry of two revisions we
have a list of the versions merged into both of them, and therefore a
list of what is new on either side.  By feeding those lists into the
weaves for each file, we can see what lines are common or new.  We can
also use the ancestry list to find a good 3-way base, without needing
to traverse the graph.

--
Martin




More information about the bazaar mailing list