tags:

views:

93

answers:

3
+1  Q: 

Svn Switch 2 repos

Dear All

I Have 2 repos with ! Working Copy Repo A as the Testing Version. Repo B as the Live Version.

Default Commit And Update of my WC is from Repo A.

I Want to switch from Repo A to Repo B without update data from Repo B. Because i want to commit data of my WC to repo B.

But When i switch from Repo A to Repo B, My WC contents from Repo B.

How can I Switch the Repo A to repo B without update data from Repo B into my WC?

Thanks

+2  A: 

You don't do this by switching a working copy to a new repository and checking in - you do it by using the "svn merge" command which was designed for exactly this purpose.

  • Check in all outstanding changes in the "testing" branch.
  • Check out a new working copy of the "live" branch.
  • Within the new "live" working copy, use svn merge to apply all changes since you branched off the testing repository:

    svn merge -r 1:HEAD http://svn.yourhost.com/repos/branches/testing

(This assumes that the revision at which you branched off the testing repository was 1 - if not, change that 1 to the correct revision).

  • Check in all the changes to the live branch.

If you only want to merge changes to a few files and not everything, you can change into the directory where those files live in the (live) working copy and extend the URL to the testing working copy to specify an individual file.

caf
+1 brilliant image :)
Rytmis
A: 

I have different branches in One Repository

My Wc default in Branch A and then I Want to switch to Branch B

i Just want before i Commit to the repo when I switch from Branch A to Branch B the data in my WC is from branch A.Not From Branch B. I want to Commit some selected files of My WC in Branch A to Branch B?

Yayan
You should update your question to reflect this. I have updated my answer - "svn merge" is still the way to do this.
caf
+1  A: 

If you are using subversion, you need to bookmark this book and refer to it whenever you are doing something you don't already have a process for, like setting up your repositories. The specific areas that address your question are repository layout and planning your repository organization. Subversion is a great tool, and is fairly flexible, but it does impose some requirements, one of those as the answer with the fantastic picture says, is that you must have related objects in the same repository.

Kevin Peterson
Agreed, read that book and keep it handy.
caf