How To Make a Patch

The following steps will show you how to make an hg patch

  • Ensure your hg repository is up to date with firestorm:
 $ hg pull 
  • Back up any changes you have made, then update the working directory exactly to firestorm:
 $ hg update -C 
  • Now add your changes to this repository. Verify your changes with:
 $ hg status 
  • You should now see your modified files marked with an “M”, “R”, or “A”
  • If you do not see an A or R next to a file you want to add/remove, cd to the folder with the file(s) you want to add\remove and use:
 $ hg add 
 $ hg remove
  • Commit your changes to your local repository to make a changeset:
 $ hg ci -u Yourname -m "Description of your change" 
  • Export your changeset to a patch file:
 hg export -r tip -o descOfChange.patch 
  • Upload your patch file to JIRA
  • Make sure to include the name you want listed in our credits window.
    Make sure you mention that you give us permission to use and distribute your code under the LGPL (friendly, open source) license or equivalent.
  • At this point you may want to roll back your local commit, just to make it easier to track firestorm:
 $ hg rollback 

Note: If you are on Windows and use Tortoise HG

You can use the Repository Explorer and Windows Explorer context menu extension for updating and reverting the local copy.

Patch files can easily be created on the command line:

  • Create a patch file for all changes:
 hg diff > Mypatchfile.patch 
  • Or create a patch file for specific files:
 hg diff file1 file2 file3 > Mypatchfile.patch 

More hg commands

  • fs_make_a_patch.txt
  • Last modified: 2012/10/29 11:40
  • by tank_master