Eric S. Raymond wrote on Tue, Dec 13, 2011 at 13:25:13 -0500: > C. Michael Pilato <cmpil...@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? >
Presumably: Replace requires a node to already exist at the target path. Add requires a node to not already exist. For comparison, the svn_delta_editor_t documentation talks about the relative order delete_entry()/add_file()/add_dir() of the same path in the same editor drive. > > [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? > Yes (container == node)