Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page contains some tips and tricks for working with Mercurial in the JMC Project for Committers. Note that this page is only relevant for JMC 7.x maintainers - JMC main development is happening in Git now.

Getting Started

  1. First install Mercurial (different on different platforms)
  2. Next ensure that you have an OpenJDK user (http://openjdk.java.net/census)
    If you need an OpenJDK user name and/or generate a key, follow instructions here: http://openjdk.java.net/guide/producingChangeset.html#jdkUserName 
  3. Next install the defpath plug-in (http://openjdk.java.net/projects/code-tools/defpath/)
  4. Next create a ~/.hgrc file and fill it out according to the example below.
  5. Next clone the JMC source: 
    hg clone http://hg.openjdk.java.net/jmc/jmc

Example minimal .hgrc file:

[ui]
username = youropenjdkname <your.mailaddress@example.com>

[extensions]
defpath = /usr/local/bin/hgext/defpath.py

[defpath]
username = youropenjdkname

Example, more comprehensive, .hgrc file:

[ui]
username = youropenjdkname <your.mailaddress@example>
merge = p4merge
editor = nano
 
[extensions]
defpath = /usr/local/bin/hgext/defpath.py
hgext.extdiff =
 
[extdiff]
cmd.p4diff = /Applications/p4merge.app/Contents/MacOS/p4merge
 
[tortoisehg]
vdiff = p4diff
 
[merge-tools]
p4merge.priority = 100
p4merge.premerge = True
p4merge.gui = True
p4merge.args = $base $local $other $output
p4merge.diffargs = $parent $child
p4merge.diff3args = $child $parent1 $parent2
p4merge.dirdiff = False
p4merge.checkchanged = True
 
[defpath]
username = youropenjdkname
 
[committemplate]
changeset = JMC-: <synopsis-of-symptom>\nSummary: <summary-of-codechange>\nReviewed-by: <reviewer>\n{desc}\n\n
    HG: Enter commit message.  Lines beginning with 'HG:' are removed.
    HG: {extramsg}
    HG: --
    HG: user: {author}\n{ifeq(p2rev, "-1", "",
   "HG: branch merge\n")
   }HG: branch '{branch}'\n{if(activebookmark,
   "HG: bookmark '{activebookmark}'\n")   }{subrepos %
   "HG: subrepo {subrepo}\n"              }{file_adds %
   "HG: added {file}\n"                   }{file_mods %
   "HG: changed {file}\n"                 }{file_dels %
   "HG: removed {file}\n"                 }{if(files, "",
   "HG: no files changed\n")}


You may also want to set up so that you can use p4merge for merging and diffing, and also use a template for commits. 

...