Subversion Proxy for working offline?

痞子三分冷 提交于 2019-12-10 09:57:11

问题


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?


回答1:


I think svk may provide what you are looking for.




回答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.




回答3:


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.




回答4:


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.




回答5:


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.



来源:https://stackoverflow.com/questions/1259957/subversion-proxy-for-working-offline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!