开发者

Copy only certain SVN revisions from one repository to another

I run an SVN server on a linux server. I'm going out of town for a week somewhere with no internet access, and therefore no SVN access.

So I'm trying to figure out how to take a snapshot of the repository with me on my laptop, and then merge the new revisions back into the existing repository when I get back...

  • My laptop runs Windows 7, so first off, I think that VisualSVN Server is probably the server I'll run locally.

  • I should be able to dump my current repository, and then load it into a new repository on my laptop

  • But what I'm not sure about, is when I get 开发者_如何学编程back from out of town. I'll have all these new revisions on the SVN server on my laptop. How do I dump and then load only these new revisions into the repository on my linux server?

  • If I use >svnadmin dump --revision 50:75 (assuming revisions 50 thru 75 represent the new revisions I made on my laptop), can I simply load that dump file into my existing repository on my linux server? Is it that easy? I know there is some stuff with regards to repository UUIDs that might cause some issues...

  • One more note, I'm the only developer contributing to this SVN repository at the moment. So no code merging will be required.

UPDATE

I wasn't aware that I could access a repository locally simply using file:///. So that will probably work better than having to run VisualSVN Server. However, the primary question still remains: How do I get the new revisions from one repository to another?


If you're the only developer, perhaps you could just take the repository with you.

Access it with the file:/// protocol while you're away, then put it back on the server when you return. . .


To extract a set of revisions (nn to mm) from a repository:

svnadmin dump --incremental -r nn:mm /path/to/repository > /path/to/dumpfile.svn

The --incremental option allows you to merge this set of changes without bringing the entire baseline along with the import.

To apply those revisions to a repository:

svnadmin load --ignore-uuid /path/to/repository < /path/to/dumpfile.svn

The --ignore-uuid option allows the import to strip out uuid information from the source repository.

I would restrict this operation to repositories with a common revision heritage otherwise the load would probably fail.


I would recommend making a git or mercurial local repository right on top of your local working copy.

You can add the .svn folders and the artifacts to the .hgignore or the .gitignore files to keep the repository clean, and then when you get back you can just do an svn commit of the changes, or if you want to get fancy do a staged commit back to subversion for every significant unit of work you checked into mercurial/git while you were on the road.

Both of those repos make it really easy to keep your own local working copy in revision control, and to easily sync to defined check in points in the history.


A non-sophisticated approach would be to simply checkout everything you'll need, work some, play some, work some more, enjoy your surroundings, meet some new people, work some more, and then when you get back, commit. A week can seem like a long time to go without committing, but when I'm away, especially those non-internet places, I tend to not do NEARLY as much work as I had intended.

WinZip can help if you need to take a "save game" snapshot now and then.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜