3

What is the best approach for working at a customers site (with several people) where there maybe not internet access the whole time and using a subversion repository?

(Migrating to Git or Mercurial is out of the question at the moment)

But wouldn't it be possible to leverage something like, for instance the Git SVN Integration, to create a proxy which acts like a subversion repository for the clients and may be used at the end to synchronize the changes back to subversion? Is there already something like that available?

Jon Adams
  • 24,464
  • 18
  • 82
  • 120
Mauli
  • 16,863
  • 27
  • 87
  • 114

5 Answers5

3

I think svk may provide what you are looking for.

pgb
  • 24,813
  • 12
  • 83
  • 113
  • is svk still alive? http://svk.bestpractical.com/recent/changes doesn't look very promising. On the other hand http://svk.bestpractical.com/view/UsingSVKAsARepositoryMirroringSystem sounds very much like my use case. – Mauli Aug 11 '09 at 16:39
  • I don't use it, so I'm not sure. The latest version is available here http://search.cpan.org/dist/SVK/ and is dated as of October 2008. – pgb Aug 11 '09 at 18:00
  • I saw that too, but a outdated website is indicator for bad health of a project. – Mauli Aug 12 '09 at 07:57
  • I agree. You may want to ask the guys in this question http://stackoverflow.com/questions/808803/svk-checksum-mismatch about their experiences. – pgb Aug 12 '09 at 12:06
2

Actually, there is a tool in Git called git-svn. You can find more information here: http://git-scm.com/docs/git-svn

You use git as your primary VCS, and than sync with SVN repository.

Marcin Cylke
  • 2,100
  • 2
  • 21
  • 40
  • But I don't want to use git on the client side right now. Thats the whole point of my question. – Mauli Aug 11 '09 at 13:02
  • I've misinterpreted the line: "But wouldn't it be possible to leverage something like, for instance the Git SVN Integration, to create a proxy which acts like a subversion repository for the clients" – Marcin Cylke Aug 11 '09 at 14:17
  • The thing is, if the clients had to change to git as well, each one would have to learn the git conventions, the buildserver would have to be reconfigured, and so on. My intention is just to point the name of our subversion repo to the proxy and none of the clients would realize that the actual subversion server isn't there. – Mauli Aug 11 '09 at 16:10
  • 1
    Unfortunately there is no git-svnserve (yet) for having Git being a server for Subversion client (equivalent to git-cvsserver for CVS access) – Jakub Narębski Aug 11 '09 at 22:11
  • There is a git-cvsserver? Neat! But git-svnserver would be exactly what I needed in my case. Maybe somebody is working on it ... – Mauli Aug 12 '09 at 07:56
1

Not enough rep to comment yet, but I wanted to point out that svk is officially 'dead'; the project is no longer being improved by the previous maintainer, which was pretty much one guy. Essentially, the maintainer of the project said: "svk was cool, but now everyone knows that you should use distributed tools, so it's not worth maintaining anymore."

The official 'end of life' style blog post can be found on Best Practical's website, in their blog post on the topic.

That said, svk is probably still the right tool. Even if a git-svnserver existed, you wouldn't be able to do multiple commits remotely using the SVN client. However, learning SVK isn't really all that different from learning git. In the end, I think that git-svn is probably the tool you want, because your use case -- Using the SVN client to commit multiple changes then push to a server -- isn't possible. The backend can stay SVN or what have you, but you're going to have to learn some different client, and git is probably the right one.

0

You may be able to use SVK which is a set of Perl scripts built upon Subversion that offers some DVCS-like functionality. I have used SVK before but only in a very simple way. I understand that it can do this sort of offline proxy operation.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
0

You can checkout from Subversion using Git or Bazaar (and I guess Mercurial too), go to the customer site and work offline making as many "local commits" as you want, and when you have connectivity again, you have various options to get those changes back to Subversion. Let's go over the steps quickly.

  1. Checkout from Subversion using Git (git-svn) or Bazaar (bzr-svn):

    # using Git
    git svn clone SVN_REPO_URL
    # using Bazaar
    bzr branch SVN_REPO_URL
    

    These don't always work perfectly, especially if the Subversion repository is large. The syntax is probably similar with Mercurial too. Try the tool you prefer, if it doesn't work try another.

    Keep in mind that the clone/branch step can take a long time, as these tools fetch the entire repository, not just the latest revision like Subversion.

  2. Work at the customer site (or disconnected, or in the coffee shop) and commit changes, as many as you want. You don't need network connection, as these are distributed VCS tools, the entire repository exists locally, and your commits will be in this local repository.

    Note that in addition to being able to commit locally, you can do all other repository operations, such as browsing the history, since everything is all in the local repository.

    Of course you need to be familiar with Git/Bazaar in order to be able to use it.

  3. Getting your local changes back into Subversion. There are two main ways: rebasing and merging. Rebasing means rewinding your local changes to the point of your checkout, fast forwarding the changes in the Subversion repository that you missed out, and replaying your changes on top that, and then pushing those changes to Subversion.

    Using Git:

    git svn rebase
    git svn dcommit
    

    Using Bazaar:

    bzr rebase
    bzr push :parent
    

This is kind of advanced use of the tools. For one thing you have to install additional plugins (git-svn if you choose to use Git, bzr-svn and bzr-rewrite if you choose to use Bazaar (though these are included in the default installation in Windows and Mac OS X), and you need a working knowledge of these tools to use them effectively.

janos
  • 120,954
  • 29
  • 226
  • 236