views:

45

answers:

4

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?

+2  A: 

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

William Leara
Taking it with me is what I was intending. But how do I copy only the new revisions from the repository on the laptop back into the original svn server? Or are you suggesting that I delete the existing SVN server and dump/load the entire repository from my laptop into a new one on my server?
Jakobud
I was suggesting you could take the whole thing with you... i.e. the directory on the server that contains the conf, db, hooks, etc. directories -- just copy that directory from the server onto your laptop. Access it like "svn checkout file:///c:/svn/repos". When you return, delete the repository directory on the server and copy your local copy from the laptop.
William Leara
... kind of like a do-it-yourself distributed SVN source control system. :)
William Leara
+1  A: 

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.

John Weldon
I Would even go further and use tools like hgsvn or git-svn, which are able to automatically copy the local history to subversion.
Rudi
A: 

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.

Amardeep
A: 

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.

Chris Thornton