Unsigned
Unsigned

Reputation: 9936

Correcting SVN copy/move

Another developer on the project moved a versioned folder without properly doing it via SVN. So SVN shows a directory tree deleted, and another one created, and doesn't show that one was simply the result of a rename of the other. This screws with peg revisions, difs, and source history.

Is there any way to fix this, for example via svndump?

Basically, to mark trunk/b as a copy-from trunk/a.

Upvotes: 2

Views: 132

Answers (2)

TridenT
TridenT

Reputation: 4909

You can just branch from the version before the modification, do the right rename, then merge this to the trunk.
You will need to of course report modification from the 'new' directory during the merge.

This way, you have the history !

Or if the log has few revision, you can get a patch from its modification, revert the modification into svn, and modify by hand the patch to exclude the delete / create operations.

Upvotes: 2

retracile
retracile

Reputation: 12339

You can hand-edit the svndump file for that one commit to drop the content of all the additions and change it to a single addition of trunk/a with a copy-from and copy-from-rev. Then you would need to dump all previous revisions and all following revisions, then load all the revisions in order into a new repository and replace your repository. Then you need everyone to checkout from the new repository and trash their old working copies.

You can avoid the hand-editing bit, assuming the bad rename was the only thing in that commit. Suppose the bad revision is $REV. Dump revisions 0 up to (but not including) $REV. Load those into a new repository. Checkout from the new repository, do the correct rename, and commit. Do an incremental dump of $REV+1 through HEAD in the old repository and load into the new repository.

Upvotes: 2

Related Questions