No announcement yet.

A proxy to behave like a “virtual” SVN server connected to a remote repository?

  • Filter
  • Time
  • Show
Clear All
new posts

  • A proxy to behave like a “virtual” SVN server connected to a remote repository?


    I have a remote SVN repository that I have no permissions to administrate. That repository server has no extra features except of regular SVN operations, and it does not contain any (useful) SVN hooks. I'm interested in setting up of some kind of a local proxy (not sure how exactly it may be called) to the remote repository (e.g., when someone commits the changes to the local "virtual" repository, the local server must commit the changes to the remote one), and it would be really and really great if such a proxy could support SVN hooks so I could configure my shared (LAN) set of SVN hooks for everyone in the development team.

    There were two ideas for this, but neither was good.
    1. Setting up TortoiseSVN hooks, but this solution is weak for several reasons. It would be nice to share the common set of SVN hooks for all members of the development team (+ it does not require any configuration management for any member locally). Another reason is that some people prefer TortoiseSVN, but some others prefer, let's say, IntelliJ IDEA internal SVN support.
    2. svn:externals is controlled by a SVN client, so it just can't cooperate with a "proxy" hook set.

    So what I'm looking for is, let's say, just like a regular proxy server but that behaves like a "virtual" SVN server. Is it possible at all (especially for Windows)?

    Thanks in advance.

  • #2
    If I am reading this right you just want to use svnsync in a master-slave configuration where the remote svn is the master and your local guy is the slave. You setup your local SVN setup with "SVNMasterURI" which is the URL to the master and it acts as a write-thru proxy so your guys on the lan still commit to the local like now but the commit is passed behind the scenes to the master, then the master turns around and sends the commit back to the slave (on the lan). You can still setup lan and wan hooks with this config.


    • #3
      Thank you very much for the reply!

      Yes, you understood the question exactly, and now, at least, I have a common view of what I am looking for. But let me ask you, does it mean that:

      1) svnsync has to sync whole repository, or is it even possible not to sync the repository at all? (at least I can't understand of why it has to be synced - just to auto-commit?...)

      2) the slave server becomes dedicated to the master server entirely? (so, the local one has to be a total slave, and every its locally hosted repository must be a clone of the remote one...)


      • #4
        You pretty much have to do it that way yes. The issue is that you need to setup a scenario where only one server accepts commits. If you don't you can't truly replicate the locations, someone might commit change 22 on the remote machine which is totally different than another change 22 commit on your local, a post-commit trigger from local to remote would create change 23 and the local users will never know that remote change 22 even exists, ever (plus this scenario could lead to conflicts which would prevent an automatic trigger from working). If you want the two machines to be truly in sync then you can commit to just one. Svnsync will sync the whole repository just the first time you run it, each time after that it is syncing incrementally, so just the most recent changes are sent and this would only be multiple changes if svnsync failed on some post-commits due to network outage or something like that which affected writing to the slave so when connection is restored all the changes since the last successful svnsync would be included (catches up the slave if it falls behind the master). With a post-commit trigger that just runs the commit again if it fails you will have to manually rsync the locations or something like that each time.

        You can decide which is the master and which is the slave but the idea is you choose one as the master read-write server and any other server instance is the read-only slave with the write-thru proxy to the master enabled (you can have multiple slaves). You can setup svnsync on a repo-by-repo basis so you might only sync some repos and not all of them.


        • #5
          I'll try to follow the exact steps you described above, because it's a very new and advanced SVN area for me. Anyway, your help and recommendations are very appreciated. Thank you very much!