How To Create Patch For Stendhal: Difference between revisions
Content deleted Content added
imported>Kymara |
imported>Hendrik Brummermann No edit summary |
||
| (54 intermediate revisions by 3 users not shown) | |||
Line 1:
{{Navigation for Stendhal Top|Developing}}
{{Navigation for Stendhal Developers}}
<div style="border:10px solid #A00; padding: 2em">
'''Warning''': This page is outdated. We prefer Pull Requests on Codeberg or GitHub.
</div>
If you want to contribute to Stendhal with some changes to some files you can ease us integrating the changes if you create a patch file for your changes.
Line 4 ⟶ 14:
There are a few neat ways to make a patch file. We are going to describe here how to create a patch on each of this ways.
Once you have tested your patch please add it to our [http://sourceforge.net/tracker/?func=add&group_id=1111&atid=301111 sourceforge tracker].
As a prerequisite for both ways of creating a patch is a checked out version of Stendhal.
== Common best practices for
* Keep your local copy of Stendhal regularly up to date with
* Discuss your plans with the team at {{irc-arianne}}
* Update your local copy before you test your changes locally
* Test your changes locally
* Open the patch file in a text editor and review it, to check it is really adding the changes you mean to add, and nothing else
== Creating patches ==
=== Eclipse ===
If you use [[
After updating your Stendhal project you can start the patch creation by right clicking on the project. In the context menu which appears select ''Team'' and ''Create Patch'' in the team submenu. This will open up a wizard for creating patches.
Line 41 ⟶ 52:
cvs add newfile
or for a binary file like an image or tmx map file
cvs add -kb newbinaryfile
{{TODO|Verify this is possible with anon access ? }}
Line 61 ⟶ 76:
The patch file contains a section for each file that should be changed. That section starts with lines that contain the file name and path of first the old (---) and then the new (+++) version and some additional information.
Then follow sets of changes. They start with a line that contains, enclosed in @@, the line or line range from,no-of-lines in the file before (with a -) and after (with a +) the changes. After that come the lines from the file. Lines starting with a - are deleted, lines starting with a + are added. Each line modified by the patch is surrounded with 3 lines of context before and after. A
After all the changes related to one file, comes the next file definitions (--- and +++) and the next file's changes, with the @@ and + or - as above.
| |||