tags:

views:

564

answers:

3

When attempting to create a tag of a working copy we receive the error, Commit failed: File '' already exists.

In attempting to diagnose the issue and have identified the following convoluted re-creation scenario.

We have a staging environment used for testing and QA releases. Development is never done on the staging environment and the builds are done from SVN checkouts.

A full checkout is done in the staging environment and it goes through a QA cycle. Bugs are resolved in dev environments and then single files are updated in the staging environment.

When the release is ready to be tagged in the staging environment the tag command fails with Commit failed: File already exists.

This issue can be resolved by completing an SVN update on the entire directory but this is not ideal when there is new code that is not intended to be tagged.

Has anyone else experienced or have a solution? Are we completely using SVN wrong?

We use Tortoise SVN for working in our repository but also have the command line tools

+1  A: 

You are attempting to commit (tag) a mixed revision. You cannot do this.

See this SO question

Dan McGrath
This does sound like what we are doing - thanks and I'm going to review more and confirm this if this is the exact answer to the issue we are having. It does also resolve to a process issue on our end but this was not an issue with CVS (which is where we are coming from)
Dan
Thanks for this direction!
Dan
+1  A: 

When you do your staging server check out you should branch it into a "release" branch. Tag it as RC_version_1

Then you work on that branch to get it ready. Bugs are resolved in this branch (and merged back into trunk so you don't get any bugs creeping back in, very important that bit). Then you can do a SVN commit from your staging server (or infact any machine if its using this branch as its working copy).

Thats the way we do it anyway. Future bug fixes after the release have gone live can be done again to this branch, just tag each release (thats where your version number at the end of the tags comes in handy). We have just one release branch which we keep releasing off so don't really have a release candidate (RC) number just version numbers. Each time we upload a site we tag it with a new version number. We are working on automating this though to make it a bit more idiot proof.

Hope that helps

Pete Duncanson
+1  A: 

It sounds like more SVN-like way of doing what you're doing would be for your "staging environment" to be a separate branch. The QA team does their day-to-day work on that branch and developers do their day-to-day work on the trunk. As the developers fix bugs that need to be added to the QA cycle, they merge them into the QA team's branch.

This way, the QA team's working copy stays in sync with the repository, rather than drifting away. They don't need to fear the svn update command, because in order to integrate a change, someone has to explicitly merge it from the trunk to the QA branch.

Once the QA cycle is complete, you can just copy from the QA branch to the desired tag.

By the way, I would suggest you do your tags/branches directly on the repository, rather than on working copies. This way, you can avoid the overhead of copying all those files on the local filesystem.

Nick Meyer
One issue with tagging a branch directly in the repository for production is that you did not necessarily tag exactly what QA verified. A developer may have checked code into the branch that has not yet been certified for a particular build night.
Dan