[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: C. Michael Pilato <cmpilato_at_collab.net>
Date: Tue, 13 Dec 2011 10:09:01 -0500

On 12/13/2011 09:44 AM, Eric S. Raymond wrote:
> Philip Martin <philip.martin_at_wandisco.com>:
>> esr_at_thyrsus.com (Eric S. Raymond) writes:
>>
>>> # The "replace" action [?is only issued with directory copies, and?]
>>> # signifies that the existing contents of the directory should be
>>> # removed before the copy.
>>
>> Replace applies to files as well.
>
> 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.

[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.

> Can a replace include a property section?

Yes.

> 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."

> 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.

> 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.

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
Received on 2011-12-13 16:09:37 CET

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