views:

61

answers:

4

Mercurial provides a -A, --after option for moves and copies, which records those operations after they've already occurred.

How can I achieve this using Subversion?

+2  A: 

You can't only record it.

What you can do is to do the copy again and overwrite the old copy target.

tangens
what do you mean by "old copy target"?
Matt Joiner
You said, the operation already occured. With "old copy target" I ment the destination of that copy operation.
tangens
Do you think you could add some command line stuff to clarify what you mean? Afaict this is the best answer, but very ambiguous.
Matt Joiner
A: 

Subversion only supports recording merges after the fact, not copies and/or moves...

John Weldon
A: 

Bluntly, no, there's no way to do this in Subversion. Assuming you've made no other changes, what you probably want to do is an svn revert and then do an svn copy so Subversion knows you've copied the file. Or if you don't really care about history for a copied file, just svn add the new location.

eaolson
A: 

So without a better answer, here's the best mechanism I've come up with:

# file was added
touch a
svn add a
svn ci

# file was moved without versioning
mv a b

# file versioning is added
mv b a
svn mv a b

Keeping in mind you can't svn cp a b, as svn will outright refuse to copy to a target that exists unless it is a directory.

Matt Joiner