About Me

JMX, SNMP, Java, etc...

Daniel Fuchs blogs on JMX, SNMP, Java, etc...

All | Personal | Sun
tags: blogging firewall hg java jconsole jmx jvm management mbean mercurial monitoring opendmk openjdk opensource rmi snmp ssl

Table Of Contents (list all entries)

« Ingo Rockel's Thread... | Main | Building a Remotely... »
20071214 Friday December 14, 2007
How I installed the Mercurial Forest extension on my windows test machine.

The source code for OpenJDK is now available in Mercurial repositories. These repositories are organized into mercurial forests. If you are eager to work on the OpenJDK code, you will want to install the forest extension for Mercurial. Here is how I did it on my windows test machine.

Disclaimer: this is a description of the steps I followed on my test machine: I can't guarantee that it will work for yours...

Installing Mercurial on Windows

Installing Mercurial on my Windows machine was quite easy. I got the Binary Packages from the selenic.com website and followed the instructions. I had already cygwin installed. I followed the easiest path which was to install Mercurial in c:\Mercurial.

Installing the forest extension

I simply cloned the forest repository in c:\Mercurial. In a cygwin terminal:

  cd c:/Mercurial
  hg clone http://hg.akoha.org/hgforest hgforest

Then I edited c:/Mercurial/Mercurial.ini and added the lines:

  [extensions]
  forest=c:/Mercurial/hgforest/forest.py

as documented in the Mercurial Wiki.

Choosing a merge tool

There are many merge tools that you can use with mercurial. Not knowing any of them I simply picked one, kdiff3, and I followed the instructions given in the wiki.

kdiff3 on windows

At the time I did this investigation, I got kdiff3 from sourceforge.net - where I chose to download KDiff3Setup_0.9.92-2.exe. Then I followed the instructions given on the Mercurial Wiki. I created a c:/Mercurial/kmerge.bat file in which I copy pasted:


@echo off
setlocal
:: Look in the registry for KDiff3 location
for /f "skip=2 tokens=3*" %%A in (
    '"reg query "HKEY_CURRENT_USER\SOFTWARE\KDiff3" /ve 2> nul"' ) do set KDiff3Path=%%B
if "%KDiff3Path%"=="" (goto :notfound) else (goto :kdiff3)

:kdiff3
"%KDiff3Path%\kdiff3.exe" --auto --L1 Base --L2 Local --L3 Other %2 %1 %3 -o %1
if not errorlevel 0 (exit /b 1) else (exit /b 0)

:notfound
echo hgmerge: cannot find KDiff3 location in the registry.
exit /b 1

as shown in the Mercurial Wiki.

Note: The code above is borrowed from the excellent Mercurial Wiki - I am not its author. Thanks to whoever provided this!
There's also some additional info on the Mercurial Wiki so you might want to look this up directly at the source.

Then I edited c:/Mercurial/Mercurial.ini and added the lines:

  [ui]
  merge = kmerge

I was then ready to test kdiff3 using my merge test case. It worked beautifully, except that if you interrupted the tool (e.g. exit without saving) - it left some temporary files in your repository working dir.

So if you're eager to work with OpenJDK sources, I hope this story will help you!

cheers
-- daniel

PS: whatever you do with openJDK, make sure to visit Kelly's excellent posts:

Update: Ted Neward has also written an excellent post on getting OpenJDK build environment for windows: Let the JDK Hacking Begin...

Update 2: Volker Simonis has also an excellent two parts post (part I) and (part II) on building and running the OpenJDK on Linux/x86.

Update 3: Lars Werstergren has also a very nice Beginner's Guide to OpenJDK. Thanks to Brad Wetmore for pointing this out.

Tags:
Posted by dfuchs ( Dec 14 2007, 04:38:37 PM CET ) Permalink Comments [2]

Trackback URL: http://blogs.sun.com/jmxetc/entry/how_i_installed_the_mercurial
Comments:

Hi Daniel --
I am trying to install the forest extension for Mercurial on Windows following your posted instructions -- they are GREAT - thanks!
But.... it seems that this link is dead
http://www.terminus.org/hg/hgforest
and I can't seem to find a replacement. Any ideas?

Posted by Celina on March 06, 2008 at 10:13 PM CET #

Hi Celina,

Thanks for the notice. Apparently the forest repository has moved here:
http://hg.akoha.org/hgforest/

-- daniel

Posted by daniel on March 07, 2008 at 12:12 AM CET #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed
[Table Of Contents]

This is a personal Weblog, and I do not speak for my employer.

Calendar

RSS Feeds

DFuchs on DZone

Search

Links

Lookup RFC

Planet JMX

From Grenoble

Navigation

Referers