ADempiere Version Control

From ADempiere ERP Wiki

Revision as of 15:44, 23 December 2010 by Kthiemann (Talk | contribs)
Jump to: navigation, search

Contents

Installing Mercurial

Install Mercurial client

  • 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.
  • MercurialEclipse 1.7 is now available.
    • (As of version 1.7, you need to have a JavaForge user id and password, in order to upgrade/install the plug-in.)
      More information about the plug-in can be found at: http://www.javaforge.com/project/HGE
      • Tobi 12:27, 21 December 2010 (UTC) It's not a must, they just *ask* the user to register on the website

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

A clone is simply a copy of a repository in a new directory and is created by the following command: hg clone <source> <destination>

By default the clone command also performs an update (check-out) of the repositories tipmost head of the default branch.

A 'pristine' clone normally refers to a clone which is created from a remote repository and is only used to create further local clones. No development is done in the 'pristine' clone and it is created with the -U or --noupdate option, which means no 'working copy' is checked out in the cloning process.

  • 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 pristine clones basically serve as a mirror of the sourceforge repositories.

Keeping the local pristines clones up to date

To keep the pristine clones up to date, simply pull the changes from the remote repository:

hg pull

As we don't need a 'working copy' in our pristine clones, there is no need to do a 'hg update' here.


Local working clones

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 /opt/repos/sourceforge/adempiere 

These are the clones where you develop your code.

Keeping up to date

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

When you pull changes into your local clone, this just updates the repository, not the 'working copy'. To update your 'working copy':

hg update

Note that it is possible to combine these two steps in one:

hg pull -u

Pushing your changes to the remote repository

At this stage the SourceForge repositories are Read-Only. The main reason for this is that we need to keep the Mercurial repositories in sync with the SVN repositories. If we were to start pushing new changes to the Mercurial repositories, then it would not be possible to keep them in sync with SVN. The best suggestion, at the moment, is to create a special clones of the 'pristine clones' which will hold the changes we want to push to the remote repositories. We can call these our 'outgoing' repositories.

  • Create a directory for your 'outgoing' repositories:
    • For example: /opt/repos/outgoing
  • To make an 'outgoing' clone of the ADempiere repository.
 cd /opt/repos/outgoing
 hg clone -U /opt/repos/sourceforge/adempiere  adempiere

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

See Also

Personal tools