Subversion, mark a file deleted or moved after the fact

Viewed 7185

Let's say that I have two files in a Subversion repo:

workingcopy/
  file1.txt
  file2.txt

And then I rename one, external to SVN:

$ mv file1.txt fileA.txt

Now, SVN marks file1.txt as missing, fileA.txt as unversioned

$ svn st
!   file1.txt
?   fileA.txt

As far as SVN knows, I deleted file1.txt and created a completely different file fileA.txt, so it won't know to track changes between the files.


EDIT: this does work, I just can't spell filenames correctly :)

Similarly, if you delete a file

$ rm file2.txt
$ svn st
!   file2.txt

SVN only knows that a file went missing, and trying to mark it removed doesn't work:

$ svn remove file2.txt
svn: 'file2.txt' does not exist

I know that in Mercurial, you can mark a file as moved, copied, deleted, etc after the fact with the --after flag, regardless of what Mercurial sees in the working copy.

Is there a similar trick in SVN?

5 Answers
Related