views:

43

answers:

3

I did a ton of changes to our code and before I commit, I would like a friend to review. Is there a way with SVN to take a copy of my working copy (to bundle everything in a package) and apply the changes I have made so far to another machines without having to commit?

In the past, with another source control system, I was able to do the following to "pack" and "unpack" my changes. Is there anything similar with SVN?

sourcecontrol.exe pack myChanges.pack
sourcecontrol.exe apply myChanges.pack

Thanks!

A: 

Although it's possible to export all your working copy (using the export function of SVN), it is much better to commit into a branch, and let your friend diff with that branch, and do selective patching if needed.

This is adapting to a correct work-flow: always have your versions committed somewhere, this is why you're using a VCS in the first place! SVN branches are cheap, easy to create, and easy to forget once you don't need them. But most importantly, they're easy to revert to if "the unexpected" happens.

Eli Bendersky
A: 

No. The best you can do is create a branch. This is one of the advantages of using a DVCS such as Git. If you just want to share the differences, you could run svn diff, but if there are lot, that won't be a convenient way of looking it over and sharing it.

Michael Aaron Safyan
+2  A: 

Sure, you can do this with the svn diff command to create a patch file.

svn diff >my-changes.patch

You can send this patch file to other people for review using any usual method (since it is just a text file). To apply the changes,

patch <my-changes.patch

Note that if you have made changes to any non-text files, the default behaviour of svn diff is to omit the actual differences from the patch file (since the patch file is itself a text file and can't contain other types of content such as images).

The new generation of distributed version control tools such as Git and Mercurial handle this much more gracefully, including the ability to share more than one commit (set of changes).

Greg Hewgill