问题
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
回答1:
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.
回答2:
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.
回答3:
It seems that there is a better solution by using svnsync
.
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
Transfer all pending revisions from the source repository to the mirror repository:
svnsync synchronize DEST_URL
Only for selected or special occasions for copying pending revisions as explained in the manual:
svnsync copy-revprops DEST_URL [REV[:REV2]
回答4:
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.
来源:https://stackoverflow.com/questions/2239217/svn-commit-to-multiple-repositories