Domanda

I come across a strange problem when checking out project and trying to update existing files. I have several branches of my project in the svn repository. I use a single working project directory (say "proj") to check out the branch that I want to work on.

Suppose I have been working on "branch1" checked out in "proj" folder, now I want to work on "branch2". So I delete .svn in "proj", and check out "branch2" from the repository to "proj" (put all files in "branch2", branch2/*, directly under "proj" without creating folder "branch2"). The problem is that the svn checkout won't actually update the existing files, say if "file1" already exists (it is in both branch1 and branch2), it won't be updated to the version in "branch2", unless I delete the "file1", or checkout "branch2" to an empty folder. Even if I do svn update -r #rev file1, it won't update file1 actually, although the svn status file1 shows the correct #rev for file1. By the way, the output of svn checkout shows "E" for all files that already exist.

Is this what svn is supposed to behave? Do I have to delete the files so that they can be updated? I am unhappy with this behavior, since it is counter intuitive, and cause hassles to switch among branches. Would you please give some neat solutions? Thanks.

È stato utile?

Soluzione

You should use

svn switch <branch-repo path>

to switch to a different branch.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top