ADempiere Version Control
Note: This is a Draft Document - work-in-progress
Installing Mercurial
Install Mercurial client
- Follow the instructions at: http://mercurial.selenic.com/downloads/
- Set your username in the Mercurial configuration file.
- For Windows edit Mercurcial.ini in your %HOMEPATH%
- For Linux edit the .hgrc file in your home directory ~
- It should contain a section as follows:
[ui] username = Tony Snook <tspc at dodo.com.au>
Install Mercurcial Eclipse plug-in
- You can get the plugin easily using the Eclipse Update Manager, just click Help → Software Updates in Eclipse. The Eclipse Update Site for MercurialEclipse is available at this URL: http://cbes.javaforge.com/update
- Important note: for users of previous HgEclipse versions: if you have HgEclipse already installed on your Eclipse, please explicitly uninstall HgEclipse before installing MercurialEclipse 1.6.0. (This is necessary due to the plugin naming changes.) It's easy: in Eclipse, click Help → About → Installation Details → select HgEclipse → click Uninstall and confirm everything. Now you can install MercurialEclipse 1.6.0.
- Information about the plug-in can be found at: http://www.javaforge.com/project/HGE
Cloning SourceForge repositories
Available Mercurial repositories
- There are currently 4 mercurial repositories: adempiere, contributions, eevolution and localizations.
- The repositories can be browsed from:
http://adempiere.hg.sourceforge.net/hgweb/adempiere
- A list of mappings from SVN folders to Mercurial repositories and branches can be found at:
http://spreadsheets.google.com/ccc?key=0AsDcKifVZoKvdGFRVHo0bE1NVFBfRWZjLU55bkFGVFE&hl=en
Creating the local pristine clones
While in Subversion a checkout updates your working copy from a repository, in Mercurial you first update your local repository and then the working copy.
In the Mercurial terminology this is called a clone. A clone is a copy of a repository in a new directory.
- First create a directory for your cloned SourceForge repositories:
- For example: /opt/repos/sourceforge
- To make a clone of the main ADempiere repository.
cd /opt/repos/sourceforge hg clone -U http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/adempiere adempiere
- Clone any additional repositories you require, for example:
- Contributions repository:
cd /opt/repos/sourceforge hg clone -U http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/contributions contributions
- If you just want to clone a single branch of a repository, say the Libero branch of the eevolution repository:
cd /opt/repos/sourceforge hg clone -U http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/eevolution#libero libero
The cloned repositories we create here are basically a mirror of the sourceforge repositories, sometimes referred to as 'pristine copies'. Once the repositories are created, the only command we issue on them is:
hg pull
This command simply pulls in any new changes from the remote repositories, keeping our local clones up to date. The clones were created with the -U option, which means that no 'working copy' is checked out in the cloning process. Remember that these are pristine clones you will keep unmodified.
Keeping the local pristines clones up to date
To keep your clone up to date, simply pull the changes from the remote repository:
hg pull
Since this clone is a pristine copy of the remote repository you may want to maintain it up to date with a cron job.
Creating local working clones
- To start working on a project, you should create a local clone of the pristine clone. First create a directory for your local working clones:
- For example: /opt/repos/workspace
cd /opt/repos/workspace hg clone cd /opt/repos/sourceforge/adempiere
Periodically you will want to update the local clone from the pristine clone:
Check what you're going to pull:
cd /opt/repos/workspace/adempiere hg incoming
To keep your clone up to date, update the repository with these changes:
hg pull
Then, to update your working copy:
hg update
Note that it is possible to combine these two steps in one:
hg pull -u
These are the clones where you develop your code.
Pushing your changes to the remote repository
TBA
References
For more information about Mercurial:
* The Mercurial wiki. * The hgbook: Mercurial: The Definitive Guide. * Cheat sheets: http://www.selenic.com/mercurial/wiki/index.cgi/QuickReferenceCardsAndCheatSheets * The Mercurial FAQ. * HgMigrationDocs from NetBeans Wiki. * Mercurial Manual for Openbravo Developers
Keeping up to date
After you downloaded the mercurial repository you can update changes from central repository using:
hg pull hg update