views:

24

answers:

2

When we started using subversion, I created a single repository and created the trunk/branches/tags folders directly at the root level of the repository. For example, I'm accessing the trunk using an URL like this:

svn://server/repository_name/trunk

Now I'd like to add other projects to the same repository, which means I'd like to add another level between repository name and trunk, e.g:

svn://server/repository_name/project/trunk

I can easily reorganize the repository in the TortoiseSVN repository browser. But what should be done with the existing working copies:

  • is "relocate" the correct operation or does this require a fresh checkout?
  • in the first case, does it matter if the working copy contains local (uncommited) changes?
  • bonus question: would there be any difference, if I'd decided to also change the repository name?
+1  A: 

The "relocate" is the correct way, but you should commit the changes first and then do the reorganization. You change the repository as well. The relocate will handle this as well.

khmarbaise
A: 

The cleanest way to accomplish a change like this is to:

  1. Commit all your and other developers changes.
  2. Delete your and other developers working copy.
  3. Make your changes to the repository directly with a repository manager tool (ex. TortoiseSVN).
  4. Everyone checks out a new working copy. Every change you implemented in the repository is reflected in the new working copies (Name changes, moves, etc.).

In my experience the relocate command is confusing to others. As an SVN admin, I can visualize it just fine, but, in a software organization you are limited by the least common denominator. The steps above are the easiest most direct method.

If you have code that you really don't want to check in at the moment, then just leave that working copy in place and make a new working copy in another location. Just bear in mind that the old working copy is not valid for check in. Rename the root directory and delete the .svn subdirectories.

SuperJames