[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

FS copies (was: Re: M-x big-picture)

From: Greg Stein <gstein_at_lyra.org>
Date: 2001-02-07 06:36:29 CET

On Mon, Feb 05, 2001 at 06:50:37PM -0500, Greg Hudson wrote:
>...
> I've been wondering whether directories need to be handled differently
> from files, such that the history of directory operations is kept
> rather than just (possible optimized) storage of the contents at each
> revision. This sort of encompasses Greg Stein's point that we could
> lose information from a copy or rename operation because we don't keep
> track of where a new entry was copied or renamed from. But that's a
> very complicated proposition.

The "copy node" is the thing that tracks where the item came from. If you
copy "foo" to "bar", then "bar" is actually a copy node. It contains the
revision and path to "foo" (where the copy came from), and it contains a
reference to the node data (e.g. 11.42).

If you copy a directory, then a single copy node is constructed, referring
to where the directory came from. Its data pointer then points into the
nodes table.

As the FS traverses down a tree, it "remembers" those intervening copy
nodes. It can use that information to determine the history of any child
node [under a directory copy].

If you have two directory entries pointing at node 11.42 (because somewhere
a copy was performed), then the first time it is changed, it becomes 11.43.
If you change it on the other path, the FS says "woah. 11.42 isn't the head,
so we must create a branch. the new node is 11.42.1.1"

I need to apply a bit more thinking, because how does the FS differentiate
between the 11.42 change (due to a copy), and somebody trying to change
11.42 because they haven't updated to 11.43.
[ yah, yah, just look at the revision number they said they were changing;
  it isn't that easy because of our marshalling over the wire; as I said, I
  gotta ponder on the problem to see if there are holes in my thoughts on
  how to marshal the change "of *that* node" over the wire ]

Oh. Stream of consciousness email continues... it is easy. Somebody says,
"change node 11.42 thru path /foo/bar/the.file". If 11.42 doesn't correspond
to the node ID of the latest revision of /foo/bar/the.file, then we punt. If
it *does* correspond to the right node ID, yet it isn't the "head" of node
11.x, then we create the 11.42.1 branch.

[ note: the marshalling uses node ID and path, not revision and path. but
  that is okay since the ID/path must always correspond to the node ID on
  the latest rev/path. (since we can only modify agains the latest) ]

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:21 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.