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

Re: Problems with the documentation of Subversion dump format

From: Eric S. Raymond <esr_at_thyrsus.com>
Date: Tue, 13 Dec 2011 13:25:13 -0500

C. Michael Pilato <cmpilato_at_collab.net>:
> > Does a file replace differ in any way from a delete plus add of the new text?
>
> In Subversion, yes. A replacement is, like an add or a delete, an operation
> at the node level, not an operation on the contents of that node. A replace
> is an addition of a new object[1] -- with its own new line of version
> control history -- that is coincidental with the removal of some previously
> existing object that occupied the same path.

I still don't understand how this differs from a delete followed by an add.
Explain it to me like I'm reallllyyy stuuupid, please, so I can document it
and you never have to explain it again.

When I add a file at a given path, it creates new object with a
history that is tracked. When I delete that path, I destroy the
container as well as the content. If I subsequently create a new
file at the same path, it's a new object with its own history.

How is a replace different?

> [1] Most of the time. A replacement can have a copyfrom source, in which
> case its not strictly a new line of history for that object.

I think I get this part. When you replace with a copy source, you're
destroying the container that existed at this path, abd replacing it with
a new container that has history extending back through the copy source.
Is that correct?

> > Can a replace include a property section?
>
> Yes.

So, everything except a delete can include properties and they all
work the same way. Correct?
 
> > Does a replace always have text associated with it, or can it have a
> > copyfrom source?
>
> You can have a replace with a copyfrom source (a "replace with history", as
> we call it). You can even have a replace with a copyfrom source *and* text,
> such as would result from this on the client side:
>
> $ svn rm dir/file.txt
> $ svn cp otherdir/otherfile.txt dir/file.txt
> $ echo "Replacement text" > dir/file.txt
> $ svn ci -m "Replace dir/file.txt with a copy of otherdir/otherfile.txt\
> and replace its text, too."

I'll include this in the document I'm working up.

> > If a file replace can have a copyfrom source, how does replace with a
> > copyfrom source differ from add with a copyfrom source?
>
> The differ only in the fact that a replace implies the simultaneous deletion
> of some other object which previously lived at that path.

Got it. That case I understand, it's how they differ in the non-copyfrom
case that still confuses me.

> > How does a "change" differ from a "replace"? My guess is that
> > "change" is issued for nodes that are pure property changes with no
> > file content changes; is this correct?
>
> You are correct.

OK.

I'm working up a second, more formal draft of the dumpfile description.
I'll post it here for review.

-- 
		Eric S. Raymond
Received on 2011-12-13 19:26:19 CET

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