Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create "patch" between revisions?

Tags:

It seems SVN's "patch" functionality is not exactly what I want. What I really want is to create a diff of files between revisions. So, I'd choose rev1 and rev 2 and end up with a folder containing all files that were changed or added between those revisions.

Can this be done with Tortoise SVN or plain-old svn?

like image 271
Josh M. Avatar asked Jan 24 '14 00:01

Josh M.


People also ask

How do I create a patch in Windows 10?

Use File -> Open... to open the two versions for comparison. This will give you a nice view of what you have changed. Then do Tools -> Generate patch .... In the dialogue box, make sure you select Style: Unified in the Format box.


2 Answers

From the command line you could do this as follows.

All files in a folder

Create a patch in your Home folder that contains all the changes between revision 123 and 124 from all the changed files in the folder "my_project":

svn diff -r123:124 path/to/my_project > ~/my_project_changes_123_124.patch

One particular file

Create a patch in your Home folder that contains all the changes between revision 123 and 124 from only one file, name "my_project.php":

svn diff -r123:124 path/to/my_project/my_project.php > ~/my_project_changes_123_124.patch
like image 166
batigolix Avatar answered Oct 16 '22 06:10

batigolix


This can be achieved in tortoise SVN itself. Right click on the branch(folder) from where you want to create the patch >> Show Log >> Select All the revisions for which you need to create the patch >> Right Click and select Compare revisions >> This will show the changed files >> Select all the files >> Right click and select Export Revision To >> Give any path in your machine >> The files will get exported in the respective folder structure.

Alternately you can achieve this via scripting. Refer the following link for that:

http://www.electrictoolbox.com/subversion-export-changed-files-cli

like image 31
Dipu H Avatar answered Oct 16 '22 05:10

Dipu H