Editing Mercurial
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
[https://www.mercurial-scm.org Mercurial] (sometimes referred to as {{codeline|hg}}) is the source code management system used for Octave development. | [https://www.mercurial-scm.org Mercurial] (sometimes referred to as {{codeline|hg}}) is the source code management system used for Octave development. | ||
Everybody is free to '''run, copy, distribute, study, change and improve'''<ref>https://www.gnu.org/philosophy/free-sw.en.html</ref> Octave's source code, given in the main repository at https://www.octave.org/hg/octave. Use Mercurial to get the latest version of Octave <pre>hg clone https:// | Everybody is free to '''run, copy, distribute, study, change and improve'''<ref>https://www.gnu.org/philosophy/free-sw.en.html</ref> Octave's source code, given in the main repository at https://www.octave.org/hg/octave. Use Mercurial to get the latest version of Octave <pre>hg clone https://hg.octave.org/octave</pre> | ||
== Workflow reference == | == Workflow reference == | ||
Line 8: | Line 8: | ||
* Initial clone: <pre>hg clone https://hg.savannah.gnu.org/hgweb/octave/</pre> | * Initial clone: <pre>hg clone https://hg.savannah.gnu.org/hgweb/octave/</pre> | ||
You can then bootstrap, configure and make | You can then bootstrap, configure and make, maybe make install. | ||
* To update on a regular basis, you can do <pre>hg pull -u</pre> or <pre>hg pull && hg up</pre> | * To update on a regular basis, you can do <pre>hg pull -u</pre> or <pre>hg pull && hg up</pre> | ||
* To make a '' | * To make a ''working clone'', you can clone from your main Octave repository on your computer to another directory like this: <pre>hg clone octave myfeature</pre> which will clone the Octave directory into a new directory called "myfeature". You'll need to cd to the correct directory first. Then you can cd into the new directory and run bootstrap, configure, make. To prevent a fresh download of gnulib, you can specify the path to the first Octave directory's gnulib if you want. | ||
It is best practice to make a new clone directory for each feature or bugfix you work on, which makes recovery from mistakes much easier. | It is best practice to make a new clone directory for each feature or bugfix you work on, which makes recovery from mistakes much easier. | ||
Line 18: | Line 18: | ||
* To work on the stable branch instead of the default branch, make a local clone called "stable", then cd to it and <pre>hg update stable</pre> | * To work on the stable branch instead of the default branch, make a local clone called "stable", then cd to it and <pre>hg update stable</pre> | ||
* To circulate work-in-progress bugfixes: first cd to the relevant local | * To circulate work-in-progress bugfixes: first cd to the relevant local coins, then edit the relevant files, verify that it builds, then <pre>hg diff >/tmp/my.wip.patch</pre> and then upload that file to the bug tracker discussion. You can also copy-paste it into a bug discussion using ''verbatim'' tags if the patch is small enough. Accept feedback from the bug discussion and iterate your patch. | ||
* When you're ready to commit your fix, first pull and update your main Octave directory from Savannah, then pull and update your local clones. Then build again to make sure things haven't broken. Then <pre>hg commit</pre> and type a summary and context for your change. Exit the editor, saving when it prompts. Build again so your build gets the latest hg id. Type <pre>hg export >/tmp/my.patch</pre> and upload that file into the bug discussion. Wait for a maintainer to apply it with your name, then if you do <pre>hg in</pre> in your main Octave directory it'll show up as an incoming change. Do a pull and up to get that, then do a pull and up in your individual clone directories to get it there. | * When you're ready to commit your fix, first pull and update your main Octave directory from Savannah, then pull and update your local clones. Then build again to make sure things haven't broken. Then <pre>hg commit</pre> and type a summary and context for your change. Exit the editor, saving when it prompts. Build again so your build gets the latest hg id. Type <pre>hg export >/tmp/my.patch</pre> and upload that file into the bug discussion. Wait for a maintainer to apply it with your name, then if you do <pre>hg in</pre> in your main Octave directory it'll show up as an incoming change. Do a pull and up to get that, then do a pull and up in your individual clone directories to get it there. | ||
* To push to a repository, if you have push rights to that repository, you can see what's going out with <pre>hg out</pre> and then <pre>hg push</pre>. | |||
* To push to a repository, if you have push rights to that repository, you can see what's going out with <pre>hg out</pre> and then | |||
==Tutorials== | ==Tutorials== | ||
Line 35: | Line 33: | ||
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. | 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. | ||
# Get the latest version of Octave (or some Octave package) <pre>hg clone https:// | # Get the latest version of Octave (or some Octave package) <pre>hg clone https://hg.octave.org/octave</pre> or when already cloned <pre>hg pull && hg update</pre> | ||
# Make your changes (fix bug #42424) and save them. '''Make sure that your changes don't introduce new bugs!''' Thus it is recommended to [[Building | build Octave]] and to [[Tests | run Octave's test suite]] before proceeding.<br>{{Warning|Please follow the [[Contribution guidelines]] for C/C++ or Octave code files!}} | # Make your changes (fix bug #42424) and save them. '''Make sure that your changes don't introduce new bugs!''' Thus it is recommended to [[Building | build Octave]] and to [[Tests | run Octave's test suite]] before proceeding.<br>{{Warning|Please follow the [[Contribution guidelines]] for C/C++ or Octave code files!}} | ||
# Commit your changes <pre>hg commit</pre> Mercurial will open your default editor<ref>To set your default Mercurial editor, read https://www.mercurial-scm.org/wiki/editor .</ref> and ask you for a commit message. Please follow the [[commit message guidelines]], e.g. <syntaxhighlight lang="text">help.m: Display relevant topics first (bug #42424) | # Commit your changes <pre>hg commit</pre> Mercurial will open your default editor<ref>To set your default Mercurial editor, read https://www.mercurial-scm.org/wiki/editor .</ref> and ask you for a commit message. Please follow the [[commit message guidelines]], e.g. <syntaxhighlight lang="text">help.m: Display relevant topics first (bug #42424) |