Patches

From Post-Apocalyptic RPG wiki

Jump to: navigation, search

Established workflow.png This article covers an established workflow.

Established workflows have been discussed among and agreed upon by the development department(s). They should serve as documentation how these workflows are successfully utilized in the project.


This page covers working with patches in various environments. Win32 instructions are assuming that you're using TortoiseSVN as SVN client if not mentioned otherwhise.

Contents

Creating a patch

Linux

This assumes you have your source tree checked out from svn and you've edited it in place to have the feature you want to add.

  • Update your sources:
svn up
  • Resolve any conflicts that might have occurred (see the svn book for help here).
  • Make a patch.
cd top_of_source_tree
svn diff > name_of_patch.patch
  • Check the patch for errors (for example, don't include a bunch of whitespace changes, unless they're deliberate; make sure you haven't altered any irrelevant files).
  • If necessary, fix your sources and make the patch again.

Win32

This assumes you have your source tree checked out from svn and you've edited it in place to have the feature you want to add.

  1. Update your sources as described at How to use SVN
  2. Resolve any conflicts that might have occurred (see the svn book for help here).
  3. Make a patch:
    1. Right-click on the top_of_source_tree folder, and select TortoiseSVN -> Create Patch
    2. Make sure all files are necessary files are selected, and select "OK". If new files were added, you also need to enable the "Show Unversioned Files" option. You can then save the patch file somewhere to your computer.

Submitting a patch

These instructions are primarily targeted at developers who are sending in patches as they don't have SVN write access yet.

  1. Create a patch with the instructions found above.
  2. Attach the patch to the appropriate ticket in Trac. If no ticket exists, create a new ticket for the problem or enhancement that your patch addresses. Caution: use a different username in the reporter field than the "anonymous" preset. Preferably your email address so we can get back to you if questions arise.
  3. Create a post in the Programming Section of the forums to let us know that a patch is available. Include a link to the ticket.

Applying a patch

Linux

This assumes you have a clean source tree. It is simplest to apply patches if you don't have modifications of your own (otherwise you'll have to resolve conflicts as before).

  • Update your sources:
svn up
  • Apply the patch:
cd top_of_source_tree
patch -p0 < name_of_patch.patch
  • Test

Win32

This assumes you have a clean source tree. It is simplest to apply patches if you don't have modifications of your own (otherwise you'll have to resolve conflicts as before).

  • Right-click on the patch file, and select Apply Patch
  • Review the patched versions of the files, right-click on the File Patches window, and select Patch All
  • Test

Commiting a patch

These instructions are primarily targeted at developers who have SVN write access and want to commit patches that have been sent in by other developers.

First and foremost: make sure that the commit message adheres to the rules outlined in the commit guidelines. The author of a patch is the person who actually submitted the patch, not the one who commited it! If you've changed the patch to a larger extend, please name both the developer who originally sent in the patch, as well as the developer who reworked parts of it and commited it in the end.

Personal tools