How do I get access to NetBeans sources using Mercurial (hg)?
First, make sure you have Mercurial installed on your machine, along with its requirements such as Python.
Then, from the command line, you run
hg clone http://hg.netbeans.org/main/ cd main
to get the full Platform and IDE sources. If you also want the contrib/ modules:
hg clone http://hg.netbeans.org/main/contrib/
To build, simply run ant. The build will appear in nbbuild/netbeans/.