12

Is it possible to use same working copy and to put the same into two different SVN servers(commit, update,...)?

JasonMArcher
  • 12,386
  • 20
  • 54
  • 51
Saneef
  • 8,013
  • 7
  • 27
  • 42

6 Answers6

3

Yes, you can use the Relocate (thanks, Peter) command to connect your working copy with the first repository, commit there, and then relocate to the second repository and commit there as well. Better make a copy of your working copy folder somewhere else first.

Pawel Krakowiak
  • 9,300
  • 2
  • 33
  • 54
1

If multiple people would be talking to different svn servers, you'll have trouble. The two servers won't talk to each other to make sure they don't have conflicts, use the same revision numbers etc. At least, I don't know of any svn hacks that will do this. (There are other distributed version systems based around svn, such as svk.)

What's the core goal here? Can you only push to a single server, but then have a post-commit hook to replicate the change to another server, which would allow easy read-only access from the other location?

The more details you can give about what you want to do, the more likely we are to be able to help you.

Jon Skeet
  • 1,261,211
  • 792
  • 8,724
  • 8,929
1

Distributed version control systems, such as Mercurial, Bazaar or Git are better suited for such tasks. You can push you changes in any number of repositories.

Eugene Morozov
  • 13,126
  • 3
  • 23
  • 31
1

Its possible but horribly racy. I currently have to do that because my ISP is brain dead and I have a hard problem reaching various data centers in Europe. So, I push to my server in Canada which immediately pushes to the real repository.

On two occasions, I actually ended up with a different revision number (+1), which means my next svn up became very interesting.

So, I just used SSHFS (a FUSE mount) to edit files in place on the Canada copy, then committed directly. Its still a real pain and one of the many reasons why I love Mercurial so much.

Tim Post
  • 32,014
  • 15
  • 104
  • 162
0

First, checkout to each server your code, and after that make a script svn_up.sh like this:

ssh  server_one_ip_address svn up /path_to_working_copy_on_server1
ssh  server_two_ip_address svn up /path_to_working_copy_on_server2

Use sh svn_up.sh instead of svn up