Warning: this rambling e-mail is "informative": it's just informing you
of my first-time experiences with the Subversion code. Any comments
(+ive or -ive) on what I've done would be gladly received.
Last night I began to write a dump file filter (in the vein of
svndumpfilter), whose most exciting feature is that it doesn't make any
use of the Subversion libraries. That's because I couldn't get
Subversion to compile at the time.
Writing dump file parsing from scratch, according to
notes/fs_dumprestore.txt, was surprisingly satisfying, just as is
climbing a large hill "because its there".
I. A strange error which doesn't seem to cause any harm.
The first test for the filter was to give the same output,
byte-for-byte, as the input. That was acheived, except for one problem:
r1 of the test input (generated by svnadmin) had a Prop-length that was
5 bytes smaller than its Content-length! (There was in fact
Content-length bytes worth of props, incl. "PROPS-END\n".) Now, as I
understand it, revision records don't have any text content.
Strangly enough, svnadmin had no trouble loading this file. I assume it
ignored Prop-length and used Content-length instead?
II. Inadvertantly removing properties.
The purpose for my filter is to retroactively add "svn:eol-style:
native" to file paths matching *.c, etc. From looking at
libsvn_repos/dump.c, I take it properties are only dumped if the file is
new, or if they are changed. And in load.c I learned that whenever node
properties are read from a dumpfile, existing properties for the node
are cleared first.
So the problem is: if I change the dumpfile to have an extra property
for a node, then I will also need to know the existing properties so
they can be specified as well. Unless a node is being added or
properties are changed, the properties aren't in the dumpfile.
That is, if I add "svn:eol-style" to a node that isn't new, then I will
effectively be wiping any properties set in earlier revisions.
In practice this doesn't seem to have been a problem, since I only add
"svn:eol-style" when a node is added, in which case I append it to any
other properties that exist when it's added.
Another point I'm not clear on is the difference between having no prop
block in the dumpfile, and having a block that is simply "PROPS-END\n"
-- do they both cause existing props for the node to be cleared?
III. Asking svnadmin to always dump properties for nodes.
Now that Subversion is compiling (for the first time, yay!), I have had
a little play with svnadmin, and added an option called --all-props.
This option causes svnadmin to always include the properties for nodes
when dumping, even if they haven't changed.
Admittedly it's a pretty obscure feature, but I think it does mean a
dump filter can change node properties with impunity.
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Mon Dec 8 11:18:35 2003