Page 1 of 1

How to create a patch file for code contributions

PostPosted: Sat Mar 07, 2009 7:17 pm
by Graveen
The goal is to create diff patch files, with the latest SVN.
Diff patchs are so called because they easily make changes on the files they target.
The test of the code submitted is an hard process, and sometimes we ended up in a non compatible patch. Having a diff is better for everyone using the SVN;
You can, of course, and i invite you to do the same, put the code changes inline, to help comprehension of your patch!

WHY SHOULD WE USE DIFF PATCHES ?
1) patch is far more precise than code: this is a guarantee your code is compatible and not outdated with actual SVN
2) patch is really light, and can be putted inline or attached in a post
3) patch allows the code developers to quickly test and deploy your patch

WHEN SHOULD WE CREATE DIFF PATCHES ?

As often as you can, for the previous reasons.
Of course, you can put code inline for discussion and explain your changes.

TO CREATE A PATCH
1) prepare the changes, get the DoL SVN.
2) commit your changes to your local repository
3) once tested, simply right clic with Tortoise on the root folder of the SVN, menu TortoiseSVN -> create Patch
4) select the files you want to put in the diff patch
5) click ok, your patch file is created

APPLYING A PATCH
1) download the patch, or create it with notepad (give him .patch extension)
2) right click on your root SVN directory, TortoiseSVN -> apply Patch
3) browse for your patch file, right clic on the Files patches windows -> apply all
4) your patch is now deployed

Graveen

Re: How to create a patch file for code contributions

PostPosted: Sun Mar 08, 2009 10:48 am
by Dinberg
I Cleaned up some English mistakes Graveen, I'll have a look at rephrasing some things later. Also Stickied it, and moved it to DoL Contributions and Development :D

Re: How to create a patch file for code contributions

PostPosted: Mon Mar 09, 2009 5:36 pm
by BackTrack
Hm didn't know about that .patch function in SVN, cool :)

Re: How to create a patch file for code contributions

PostPosted: Sat Jul 04, 2015 9:26 pm
by DrStrange
TortoiseSVN to patch a file does not work at all. GL though.

Re: How to create a patch file for code contributions

PostPosted: Sun Jul 05, 2015 9:09 am
by Graveen
It was working flawlessly: i doubt it didn't. Generally the patch file is mis-formed, rather than the tool.

Re: How to create a patch file for code contributions

PostPosted: Fri Jul 10, 2015 10:21 pm
by DrStrange
It's ok I am learning all the scripting myself, already have many things working however there is a pile of outdated an things,additions etc I want to do. I am using this and a couple other emulators as learning ground for c# atm.