开发者

svn commit to multiple repositories

I have have a main project I am working on, which has several modules/directories. The main project is bound开发者_如何转开发 to local svn repository. however, whenever I do commit, I would like to push some modules/directories to Google code repository as well. However I only want to update from local repository. Is there a way to do it automatically? my IDE is emacs 23.

Thanks


This is how the SVN book recommends you do it. It seems pretty painful and basically revolves around having a working copy for each repo and literally copying changes between the two (you could probably also do this with SVN patches).

Alternatively you can look into using SVK (which is distribution layer for SVN, adding Git-ish functionality to SVN) to setup repository mirroring or merging to external repos. Beware, the documentation for SVK is a little disorganized. Apparently the command-line help is good.


Each working copy in SVN points to one repository. What you could do is use svn switch to change your repository to point at the Google Code repository, before updating and committing the directories you wish to be stored there. You could then switch back to point your working copy at your standard repository. This does, of course, rely on the directory structures being compatible across both of the repositories.


If not mistaken, SVN switch is not a solution.

SVN switch does not only connect (or switches) a working directory from one repository to another different repository! It also does a silent update (or checkout) from the new repository. So, if I am not mistaken, any local modifications in the working directory would get lost since would be over written by the new repository.

It seems that must have one working copy for each repository and literally copying changes between the original working directory to the others.


It seems that there is a better solution by using svnsync.

  1. Initialize a mirror repository for synchronization from the source repository. This is the first svnsync operation you run on a would-be mirror repository:

    svnsync initialize MIRROR_URL SOURCE_URL
    
  2. Transfer all pending revisions from the source repository to the mirror repository:

    svnsync synchronize DEST_URL
    
  3. Only for selected or special occasions for copying pending revisions as explained in the manual:

    svnsync copy-revprops DEST_URL [REV[:REV2]
    
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜