| 5.4.3. Handling tricky situations |
| Prev | 5.4. Using SVN | Next |
|---|
Because of limitations in SVN certain tasks are inherently difficult, particularly recovering from mistakes. Although changing the repository directly is nearly always a Really Bad Idea sometimes it cannot be avoided. These guidelines explain what to do in these situations.
Once a change has been committed you cannot un-commit it. You have to reverse the change and check in a new revision with the old code.
Sometimes you might have a number of changes in your working copy which should be committed separately but accidentally get committed all at once with a commit message that's only appropriate to one of the changes. The safe thing to do is revert the inadvertent commits then re-commit them with the right message; editing the repository directly is possible but foolishly dangerous.
Getting an import right is important because it affects the long-term usefulness of the repository. Check import commands particularly carefully before running them!
If you do make a mistake, the solution depends on exactly what went wrong. You might have run the command in the wrong working directory, or you might have used the wrong repository path, etc. The important point is whether the imported files coincide with files in the repository or not.
If none of the files in the erroneous import have the same
name as an existing file in the repository (e.g. they all ended
up in a completely new directory) then just removing the files
from the repository can be done by using the appropriate
rm command in the repository.
If the import is OK apart from an incorrect tag, the tag can probably be deleted and re-applied correctly without too much pain. (This may not be true for a misspelled vendor branch tag.)
If there is a filename clash with an unrelated file, then there's a fairly serious problem. Find a SVN guru and help him or her to fix the repository manually. You won't be popular.