From Octave
Revision as of 11:39, 12 February 2021 by Siko1056 (talk | contribs)
Jump to navigation Jump to search

Mercurial (sometimes referred to as hg) is the source code management system used for Octave development.

Everybody is free to run, copy, distribute, study, change and improve[1] Octave's source code, given in the main repository at Use Mercurial to get the latest version of Octave

hg clone
Info icon.svg
TortoiseHg is a GUI for Mercurial and it is especially recommended for users doing their first steps with source code management systems. Linux, macOS, and MS Windows are supported.

Creating and submitting patches (changesets)

If you want to share your modifications, for example to fix a nasty bug #42424, you cannot just submit your changes to Octave's main repository. You have to generate a patch (or changeset) so other Octave developers can include them into Octave's source code.

  1. Get the latest version of Octave (or some Octave package)
    hg clone
    or when already cloned
    hg pull && hg update
  2. Make your changes (fix bug #42424) and save them. Make sure that your changes don't introduce new bugs! Thus it is recommended to build Octave and to run Octave's test suite before proceeding.
    Warning icon.svg
    Please follow the Contribution guidelines for C/C++ or Octave code files!
  3. Commit your changes
    hg commit
    Mercurial will open your default editor[2] and ask you for a commit message. Please follow the commit message guidelines, e.g.
    help.m: Display relevant topics first (bug #42424)
    * scripts/help/help.m: Describe what you changed to display relevant topics
      first.  The maximal line width is 80 characters.
  4. Export the changes
    hg export -r tip -o bug42424.patch
    The final patch for submission will look like this {{file|bug42424.patch|<syntaxhighlight lang="diff"># HG changeset patch
  5. User Awesome Hacker <>
  6. Date 1591780091 -32400
  7. Wed Jun 10 18:08:11 2020 +0100
  8. Node ID 68c698c4f2fd98bf2d48234bd1da99e91763114f
  9. Parent f5c9bb5955e7c9fddef5c3c3f115201e11b43b79

help.m: Display relevant topics first (bug #42424)