Wiki
petsc / patch-instructions-mercurial
Creating a patch for PETSc using Mercurial
Clone the Repository
If you haven't already, the first step is to obtain a recent copy of the PETSc repository:
$> hg clone https://bitbucket.org/petsc/petsc #UPDATE THIS! $> cd petsc/
This creates a new folder 'petsc' containing the development repository and changes right into it.
Start Cleanly
If all the changes you applied to the PETSc code should enter the patch, proceed to the next section.
Otherwise, if you have already cloned the repository at some earlier stage and played around with it, but you don't want to keep any of your changes to files, reset the current work tree using
$:petsc> hg revert --all
To selectively bring files back to their original state, first run
$:petsc> hg status
to get a list of modified files (line starting with 'M'). For each file f
to be reverted, issue
$:petsc> hg revert path/to/f
Apply your Changes
If you haven't already, apply all the changes to the sources which should go into the patch. Please try to make a patch self-contained, dealing with only one aspect or module at a time (for example: Fixes to documentation).
Commit your Changes
Once you completed updating the source tree, let's first check a summary of changed files:
$:petsc> hg status
If all the files shown as 'modified' should indeed be patched, commit you work using
$:petsc> hg commit -m "Your commit message here"
Create the patch
Once your commit is completed, the changes with respect to master need to be extracted. To write the patch to a file myFeature1.patch
, use
$:petsc> hg export tip > myFeature1.patch
Send it over
Please send the newly created patch file(s) to petsc-dev@mcs.anl.gov
Updated