tags:

views:

412

answers:

2
+2  Q: 

SVN Diff Export

At work we have a very large code-base that we commonly export for a web application to ensure everything is up-to-date. If we develop test code it is always done in a branch in order to make sure it's not conflicting with the trunk which could unexpectedly cause a bug to get released.

My question is whether it's possible to do an SVN export but only for differences only, otherwise the entire repository has to be exported again which takes quite some time. Say for example we had a "last exported" flag, then we compare the last update dates against files and only export those that are later than the last export date.

It would be quite handy for inter/intranet systems where a full export is done in order to keep our live/repo in sync. Any ideas?

EDIT - Looking at the patch, I can't see how you create a patch for files that already exist in the repo. We've got already committed files. So I'd want to create a patch from x revision to the head and apply that to the root of my project in order to apply every single difference. I'm not sure if that's a possibility, however.

+6  A: 

We've done something almost similar (though not with a production system) in using svn diff to create a patch file, then applying that patch file using the plain old 'patch' command. svn diff accepts revision numbers, so you can generate a patch file that would include everything from a certain set onward.

Of course, this may not work so well if many of your files are binary :-)

Jarret Hardie
Fortunately our binary files are few. I'm assuming a patch file has no problems when dealing with files that haven't changed, it'd just make the patch file larger, right?
Kezzer
A patch file is really just a recipe for what has to happen to make the old version of the file look like the new version; files that haven't changed aren't even in the patch... so you're right, no problems there.
Jarret Hardie
A: 

We needed something like this too. So I wrote a small java tool.

Hope it's useful to someone: github svn-diff-export

Phil Gloyne