Greg Hudson <ghudson@mit.edu> writes:
> First, there are a couple of bits of editing operation data which
> don't seem to have any corresponding encoding in XML: ancestor data
> and directory entry property changes.
As you saw, there is a standard "ancestor" and "version" xml attribute
attachedt to <file> and <dir> tags. If they're not specified, it's
assumed to be inherited from the parent. (This is discussed,
actually, in chapter 3 of the spec.)
If you want to put a prop-change on a directory entry (instead of a
directory), it's easy. Just put within an <add> or <replace> tag, but
*not* within a <dir> or <file> tag. In fact,
libsvn_delta/tests/foo.delta has an example:
<add name="E">
<prop-delta><set name="car">buick</set></prop-delta>
<dir ancestor="/A/B/E">
</dir>
</add>
And xml_parse.c recognizes it correctly as a propdelta on a dirent,
rather than on a dir.
> Second, in addition to putting a bunch of restrictions on the flow of
> editing operations, the hierarchical structure is kind of a pain to
> code to. You have to deal with things like, "okay, this is an
> operation on a new directory entry. What was I just doing? If I had
> just begun a directory, I have to start a <tree-delta> element. If I
> was just working on a file and I haven't seen a text-delta for it yet,
> I have to output a text-delta-ref element, save the reference in the
> file baton, and end that <file> element." This is doable, but it
> would be easier, as well as less restrictive editing producers, if we
> scrapped the hierarchical XML format in favor of something like what I
> proposed yesterday.
Ugh, I think we need to talk about this. It sounds like you're
unwilling to keep track of a "stack" within your editor
implementation, and yet Karl and I have been using stacks all over the
place; it's part of the depth-first lifestyle. I'm not sure why this
bugs you so much...?
> So, I think I'm going to set aside the work I've done so far, flesh
> out yesterday's XML format proposal, and start working on that
> (parsing as well as outputting). If people think we should stick with
> a hierarchical format (with all the corresponding restrictions on
> delta producers), they should speak up.
Karl and I will discuss and speak up soonly. I'm a little wary of
instituting such a major change on the turn of a dime; I think such
change has much larger impacts than is immediately obvious.
Received on Sat Oct 21 14:36:10 2006