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

Re: multiple replace_root() calls per edit

From: Karl Fogel <kfogel_at_galois.collab.net>
Date: 2001-01-02 21:17:43 CET

Regarding the multiple replace_root() issue:

I'd like to think about this from a high-level for a moment.

The idea behind allowing only one replace_root() per edit was that the
edit's purpose is to change one tree into another, and in any tree,
there exists a node above which no changes took place -- the tree's
root node, if nothing lower. Whatever that uppermost-changed node is,
it is the "root" in replace_root().

Now, it may be that the actual changes are scattered among entities
far down in the tree, leaving many intermediate directories with no
changes at all. But even in that case, one replace_root() call is
certainly sufficient: you just end up with a lot of
replace_directory() calls containing more replace_directory() calls,
all the way down until the leaf layers, which will have actual
replace_file()'s, etc.

There was a nice symmetry to this, because it meant that one change
"atom" was always a perfectly nested tree-delta (either in XML or as a
pattern of editor calls). It had one root, and everything took place
within that root.

If we allow multiple change-roots, so the thinking went, then it's
hard to tell the difference between a single atom and a group of
several atoms.

However, in practice, I doubt it would be hard to tell the difference.
For updates (which aren't atomic anyway, but never mind that), the
grouping is by the edit itself -- everything from get_editor() to
close_edit(). For commits, the same is true on the client side, and
on the server side, the txn is the real grouping. And when expressed
in XML, an "atom" would just be everything inside a delta-pkg.

Therefore, having multiple replace_roots() results in no theological
inconsistency as far as I can tell.


Karl Fogel <kfogel@galois.collab.net> writes:
> Greg Hudson <ghudson@MIT.EDU> writes:
> > > Greg, we had an exchange earlier about calling replace_root()
> > > multiple times per edit. You said it sounded like a reasonable
> > > thing to do, but I said there should only be one call per edit.
> > [...]
> >
> > So, what should the XML output editor do if it gets multiple
> > replace_root calls?
> Hmm. I see what you mean. Right now, we have an artificially imposed
> requirement that one delta-pkg contains one tree-delta. We could
> allow it to contain multiple tree-deltas. Would that do any harm?
> (I guess then you'd output the "<delta-pkg>" when get_xml_editor() is
> called, not when replace_root() is called... Not sure when it's done
> right now.)
> Well, I don't see a problem with just doing the obvious thing, but I
> have a feeling JimB's brain has been all over this ground, and want to
> hear what he has to say. Poor guy, he's gonna have one heck of a mail
> spool to catch up on when he gets back tomorrow. :-)
> -K
Received on Sat Oct 21 14:36:19 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.