Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN create patch from committed code?

Tags:

diff

svn

Is it possible to create a patch (diff files) for all files that were affected during a commit AFTER the commit? These files would have same version number and I need the diff of each file from their prior version.

like image 550
septerr Avatar asked Feb 22 '13 19:02

septerr


People also ask

How do I create a patch in svn?

Creating a Patch File First you need to make and test your changes. Then instead of using TortoiseSVN → Commit... on the parent folder, you select TortoiseSVN → Create Patch... you can now select the files you want included in the patch, just as you would with a full commit.


2 Answers

If you know commit number, then use

svn diff -c N path 

Where N is commit number and path is path to your working copy.

like image 198
Mikhail Vladimirov Avatar answered Sep 29 '22 03:09

Mikhail Vladimirov


Alternative, when using windows + tortoiseSVN :Go to your sourcecode directory, rightclick on the directory (to open the tortoise context-menu) and select "Show Log", select both revisions (ctrl-click) and then right-click and select "Show differences as unified diff" from the context menu. A window will pop up showing the differences, which you can then save as a patch.

Update: Holding Shift, when clicking on "show differences as unified diff" makes a dialog pop up where you can select the diff options (ignore eol changes, ignore whitespace changes, ignore all whitespaces). This is useful if e.g. the line-endings changed between versions (the entire file would otherwise show up as 'changed')

like image 39
kalmiya Avatar answered Sep 29 '22 03:09

kalmiya