|
From: | Jon Bright |
Subject: | Re: [Monotone-devel] another newbie question - nonlinear ordering |
Date: | Wed, 20 Apr 2005 22:03:06 +0200 |
User-agent: | Mozilla Thunderbird 1.0 (Windows/20041206) |
Hi, I've reordered your mail slightly to put your ending question at the start. K. Richard Pixley wrote: > Is this history really lost in monotone? Or how is this handled?It was, once upon a time. Since then, though, changesets were added. A changeset is (roughly speaking), the SHA1 over a textual representation of the changeset's parent and the changes within the changeset.
Start with an empty file, f0. Apply some initial content, delta1. f0 + delta1 = f1
Let's say you get a manifest SHA of FEDC for this, and a changeset SHA1 of 1234.
It occurs to me that if I now apply a change, delta2, to this file, (tree, subtree, repository, whatever):f1 + delta2 = f2
The manifest SHA1 of f2 is 5678, say. To get the changeset ID, you now do SHA1(1234 + 5678) -> ABCD.
And then I back out that change by applying the inverse delta2, delta2', then:f2 + delta2' = f3 = f1.
Manifest is FEDC again. Changeset, though, is SHA1(ABCD + FEDC), which is something different.
Since the hash for f3 and f1 will be identical, we can no longer talk meaningfully about a linear sequence of revisions. That is, revision id = SHA1(f3) = SHA1(f1) no longer has a single ancestor nor is there necessarily even a deterministic path from f3 back to the empty file. f3 and f1 are different not in content, but only in ancestry.
Changesets effectively encode the complete ancestry. Clearly, I've been simplifying here. change_set.[cc|hh] have more details in their comments.
-- Jon Bright Silicon Circus Ltd. http://www.siliconcircus.com
[Prev in Thread] | Current Thread | [Next in Thread] |