Maintaining 2 SVN Repositories

This is a discussion on Maintaining 2 SVN Repositories within the General Discussions forums, part of the Community Boards category; Hi all, I have two SVN repositories that I would like to mirror, one that is public facing, hosted remotely; ...

  1. #1
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591

    Maintaining 2 SVN Repositories

    Hi all,
    I have two SVN repositories that I would like to mirror, one that is public facing, hosted remotely; and the other for my private use hosted locally (in case the public one should ever go down). For every commit I need to have it commited to both repositories. I have not yet found a non-frustrating way to do this; I've tried:

    a) committing changes to one then copying over changed files and commiting to the other (and thereby commiting myself to an insane asylum)

    b) committing changes to my private repository then every so many changes doing an svn dump then load into the public repository. And with it dumping about 80% of my bandwidth cap and 5+ hours of upload time, not to mention the public database is rarely current.

    c) I tried dumping just the diffs; however this neither worked, or if it did would be just as frustrating having to dump-load every change made

    What is a solution, possibly scripted, that I could use to commit a single change to two repositories? Or in other words, how do I maintain two identical SVN repositories without going insane?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,674
    Or is SVN the wrong tool for the job?

    I'm sure you could write little wrappers around 'ci' etc, which basically do the same command twice over.

    > And with it dumping about 80% of my bandwidth cap and 5+ hours of upload time
    How much historic junk do you have in there?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,941
    Quote Originally Posted by Salem
    Or is SVN the wrong tool for the job?
    Yeah, I had a similiar desire myself and switched to the use of a distributed version control system.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Disrupting the universe Mad_guy's Avatar
    Join Date
    Jun 2005
    Posts
    258
    SVN is pretty much not able to do this (easily,) by design. What you really want is the ability to 'offline commit', meaning you can just make commits that stay in your repository and then you push them publically when you want.

    There is a tool, SVK, which allows you to do this in the context of SVN (specifically, it is an SVN client with offline commit and other stuff.) Note: it will *not* make it easier to commit to two different SVN servers, it will merely allow you to pool commits locally until you decide to push them to the actual, user-viewable server.

    I however, recommend jumping ship from SVN and using a distributed version control system like Mercurial or Git. They allow you to work exactly how you want and offer much more.
    operating systems: mac os 10.6, debian 5.0, windows 7
    editor: back to emacs because it's more awesomer!!
    version control: git

    website: http://0xff.ath.cx/~as/

  5. #5
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    In terms of "historic" I have everything since 1; however all the junk is filtered out. Is that not normal?

    Thanks for the suggestions all, I will look into Git (which is distributed version control?). For those who have made the change, how much of a hassle is it to adapt to Git coming from SVN?

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,941
    Quote Originally Posted by @nthony
    Thanks for the suggestions all, I will look into Git (which is distributed version control?). For those who have made the change, how much of a hassle is it to adapt to Git coming from SVN?
    I am not a git user, but when I switched to using Bazaar, I found it quite easy to adapt to the similiar command set. Of course, things get more complex if you want to move further into full utilisation of DVCS, but you can always progress in steps.

    I have heard comments that git is likely to be harder to switch from Subversion than Bazaar and Mercurial, but then git advocates also claim that after you achieve proficiency it is superior (but then all software tools more or less say the same thing, heh).

    Note that all three of the DVCS mentioned have some support for working with Subversion repositories (and working copies), which helps in a gradual conversion. I believe that Bazaar has the best support with respect to Subversion, but I could be mistaken.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    Quote Originally Posted by laserlight View Post
    Note that all three of the DVCS mentioned have some support for working with Subversion repositories (and working copies), which helps in a gradual conversion. I believe that Bazaar has the best support with respect to Subversion, but I could be mistaken.
    Thanks, this will be important. Also glad to discover that SourceForge supports all VCSs mentioned in this topic!

  8. #8
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    You can do this with SVN easily.

    Write an SVN hook. Use `svnsync` to synchronise the repositories. The end.

  9. #9
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    Quote Originally Posted by zacs7 View Post
    Write an SVN hook. Use `svnsync` to synchronise the repositories. The end.
    not sure why the hook is necessary, but I think it works, thanks... I was just starting to learn Git

  10. #10
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    I highly recommend trying git, it's fantastic. Much like you, I was working on a SVN-managed project and I wanted something similar (offline commits), and many people suggested I try a distributed VCS. I picked git (I'm sure bazaar and many others are great too), migrated my SVN repository over to git with a simple one-line command (I forget exactly what, just google it), and that was it. All SVN history was incorporated into git with no issues.

    It takes some time to learn a new version control system, and git's learning curve is probably higher than a simpler system like CVS, but it's well worth it in the end in my opinion . . . .
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Free svn
    By cs_student in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 08-13-2008, 07:04 PM
  2. problems in compiling svn from source...
    By rockyrakesh1331 in forum C++ Programming
    Replies: 3
    Last Post: 05-30-2008, 06:34 PM
  3. How to resolve conflicts in SVN?
    By jutirain in forum Tech Board
    Replies: 0
    Last Post: 01-19-2008, 09:51 PM
  4. Maintaining Global Vars Between Libraries
    By Canadian0469 in forum C Programming
    Replies: 9
    Last Post: 11-27-2007, 11:29 AM
  5. Free SVN server
    By Magos in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 09-28-2006, 12:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21