[MERGE] faster common ancestor

Aaron Bentley aaron.bentley at utoronto.ca
Tue Mar 7 03:20:01 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
| On Mon, 2006-03-06 at 14:37 -0500, Aaron Bentley wrote:
|
|>>+    # pick a root. If there are multiple roots
|>>+    # this could pick a random one.
|>
|>We should always pick NULL_REVISION
|
|
| So if we have explicit knowledge about other unavailable revisions, and
| no revisions have no parents, where should we put NULL_REVISION ?

Okay, I take this back.  For some calculations, we may use a synthetic
root, but it needn't be the NULL_REVISION.

|>>+    def get_revision_graph(self, revision_id):
|>>+        result = {}
|>>+        for source in self._revision_sources:
|>>+            try:
|>>+                result.update(source.get_revision_graph(revision_id))
|>>+            except (errors.WeaveRevisionNotPresent,
errors.NoSuchRevision), e:
|>>+                pass
|>>+        if result:
|>>+            return result
|>>+        raise e
|>
|>So here's another behavioural change, because the old revision_graph
|>would return a combination of the two; if revision_a had a ghost, it
|>would hit revision_b.  Here, if either repository is missing the tip
|>revision, all its data is ignored.  I am not certain whether this can
|>cause consistency problems, but it seems like it could.
|
|
| I think you are saying that 'if one repository has a ghost in the other,
| and the other is missing the which which references it, the
| multiplerevisionsources adapter should ensure that the returned graph
| contains both revisions' ?

That's an accurate description.  I'm not sure whether is is required for
picking a common ancestor, but it's what the previous code did, so
anything else is a change.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEDPvh0F+nu1YWqI0RArMUAJ0T2JmA7GUgdrOw2KHgL2FsVIDW6wCeLX9P
PT44Sd1ztemSXLSsYRVMl8E=
=wRnV
-----END PGP SIGNATURE-----




More information about the bazaar mailing list