Editing Mercurial

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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 95: Line 95:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
hg pull https://www.octave.org/hg/octave   # Get latest remote "tip"
hg pull https://www.octave.org/hg/octave       # Get latest changes from main repo, bookmark "@"
hg update -r my-gsoc                       # Activate bookmark "my-gsoc"
hg update -r my-gsoc                           # Select my bookmark
hg merge tip                              # Merge "tip" into "my-gsoc"
hg merge @                                    # Merge changes of bookmark "@" to bookmark "my-gsoc"
hg commit -m "maint: merge default to my-gsoc"
hg commit -m "maint: merge default to my-gsoc"
hg push ssh://student@public.server.org/octave
hg push ssh://student@public.server.org/octave
Line 104: Line 104:
=== Preparing for code reviews ===
=== Preparing for code reviews ===


At the time of the mid-term or final review (or whenever the mentor requires it) students should prepare their code for review and possibly inclusion into the main repository.
At the time of the mid-term or final review (or whenever the mentor requires it) students should prepare their code  
 
for review and possibly inclusion into the main development branch. To this end students should:
# Create a full log of changes <pre>hg log --template=changelog --no-merges --user student-name</pre> If students have been following the [[Commit message guidelines]] the output is a good starting point for the commit message in the next step. Some manual post-processing might be necessary:
<ol>
#* Each touched file should appear only once.
<li> prepare a full log of their changes, listing files that have been touched
#* Do not mention backed-out commits.
and including a summary of the purpose of those changes. If students have been following
# Prepare a singe patch (changeset) including all code that should be submitted for review <syntaxhighlight lang="bash">
the [[Commit message guidelines]] the following command will give a good starting point<br>
hg pull https://www.octave.org/hg/octave  # Get remote "tip" and "@"
<code> hg log --style=changelog --no-merges --user student-name </code><br>
hg update -r @                             # Activate    bookmark "@"
this message should be edited so that
hg merge my-gsoc                          # Merge "my-gsoc" into "@"
  <ol  style="list-style-type: lower-roman;">
hg commit
<li> each touched file appears only once </li>
hg export -r tip -o mid-term-review.patch
<li> changes that were backed out should not be mentioned <!--(like changeset "H" in the above example)--> </li>
</syntaxhighlight> The file {{Path|mid-term-review.patch}} can uploaded to the [https://savannah.gnu.org/patch/?group=octave patch tracker]. <br/> Finally, there is a subtle difference between <code>"tip"</code>, which is a reference to the (local or remote) changeset added to the repository most recently and the bookmark <code>"@"</code> used by the Octave developers to point to the latest remote changeset.  Often both refer to the very same changeset and they can used interchangeably.
</ol>
The main  purpose of this log is to make it easy, not only for the main mentor, but also for other developers who
have not been closely following the progress of the project to quickly understand where to look at in the code to evaluate it, but it will also be used as the commit message for the merge changeset, so it should itself comply with the [[Commit message guidelines]].
<li> prepare a merge changeset including all the code that should be submitted for review
  <ol style="list-style-type: lower-roman;">
  <li> pull from the main repository<br/>
  <code>hg pull https://www.octave.org/hg/octave</code></li>
   <li> move to the top of the main line of development and merge in the feature branch<br/>
  <code>hg up -r @</code><br/>
  <code>hg merge student-bookmark-name </code><br/></li>
  <li> create a changeset, export it and send to the mentor for review, remember to use the log created above as a commit message<br/>
  <code>hg commit </code><br/>
  <code>hg export @ > mid-term-review.changeset </code><br/>
  the file mid-term-review.changeset can then be sent to the [mailto:octave-maintainers@octave.org mailing list] or posted
  to the [https://savannah.gnu.org/patch/?group=octave patch tracker]</li>
  </ol> </li>
</ol>


== Example Mercurial configuration ==
== Example Mercurial configuration ==
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)