How To Create Patch For Stendhal: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
exlpain what a patch is. add cli link. add another best practise
imported>Madmetzger
Line 10: Line 10:
* Keep your local copy of Stendhal regularly up to date with CVS Head to avoid merge conflicts
* Keep your local copy of Stendhal regularly up to date with CVS Head to avoid merge conflicts
* Discuss your plans with the team at {{irc-arianne}}
* Discuss your plans with the team at {{irc-arianne}}
* Update your local copy before you test your changes locally
* 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
* 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

Revision as of 09:42, 30 March 2010

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.

A patch file is a record of all the changes made to the code. It is one file in a particular format which defines which source files, and which lines of the source files are to be changed, as well as the changes themself. As you can imagine this makes adding changes a much smoother process.

There are two neat ways to make a patch file. We are going to describe here how to create a patch on each of this ways.

As a prerequisite for both ways of creating a patch is a checked out version of Stendhal.

Common best practices for patches and CVS

  • Keep your local copy of Stendhal regularly up to date with CVS Head to avoid merge conflicts
  • Discuss your plans with the team at #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

TODO: list more best practice tips

Eclipse way

When you use Eclipse it is quite easy for you to create a patch against current head version in CVS. Before creating a patch you should update your local copy of the sources to the most recent version.

After updating your Stendhal project you can start the patch creation by right clicking on the project. In the appearing context menu select Team and Create Patch in the team submenu. This will open up a wizard for creating patches.

The first wizard page asks you where to create the patch. For submitting a patch to our patches tracker you should choose file as selected in the next screenshot. For creating a patch file you also have to select a file name and location for the patch. You can easily select a target folder and file name by clicking on Browse. The last thing you have to choose on this windows are the changes. If you want to bring all current differences to CVS into the patch file just tick the root node of the shown project tree in the Changes area of the window.

In the next step which is also the final step you need to specify two other options. Just select the options as shown in the screenshot and click on Finish.

After clicking on finish you will not get any further notice but the patch file should now be available in the previously selected folder.

Command line way

TODO: describe how to create a patch via command line, for now try reading http://www.kegel.com/academy/opensource.html#patches