Getting Nuxeo EP, Nuxeo Shell and Nuxeo WebEngine sources

Nuxeo EP sources shall be retrieved and worked with using Mercurial.

Have a look at part "Using the Mercurial Forest Extension" which considerably ease the use of Nuxeo sources.

Contributors to Nuxeo sources should also look at documentation about working both on 5.1 and 5.2

Getting the 5.1 branch (stable)

Use the following:

hg clone http://hg.nuxeo.org/nuxeo#5.1
cd nuxeo
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-common#1.4
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-runtime#1.4
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-core#1.4
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-theme#5.1
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-platform#5.1
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-shell#5.1
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-distribution#5.1

Optionally if you want to open/edit the projects in Eclipse do the following at the very root of the Mercurial repository:

mvn eclipse:eclipse
And then in Eclipse:
File -> Import -> General -> Existing Projects into Workspace

Note that most people working on Nuxeo EP should be cloning only one of those modules, usually nuxeo-platform.

Developers will have to use a https URL, and can include a user name and password in it if they don't want to type them every time they push: https://username:password@hg.nuxeo.org/... (This URL is stored in .hg/hgrc in your repository, you can change it after the initial clone.)

Getting a specific release

If for instance you want to get the 5.1.4 release, follow the instructions above by replacing 5.1 with 5.1.4 and 1.4 with 1.4.1.

Since release 5.1.6, we tag all the sources with the same pattern release-x.y.z (using only major version from nuxeo-platform). For example, pulling revision release-5.1.6 on nuxeo-core will get 1.4.3 source code.

To see all available tags, run hg tags

Getting the 5.2 branch

The 5.2 branch has slightly different repositories because the code has been reorganized.

hg clone http://hg.nuxeo.org/nuxeo#5.2
cd nuxeo
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-common#1.5
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-runtime#1.5
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-core#1.5
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-services#5.2
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-theme#5.2
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-webengine#5.2
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-jsf#5.2
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-gwt#5.2
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-features#5.2
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-dm#5.2
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-distribution#5.2

On recent version of mercurial, it seams that the #5.2 notation does not longer work. Instead do, for instance in replacement of the first command:

hg clone -r 5.2 http://hg.nuxeo.org/nuxeo

To see all available branches, run hg branches

Getting the full repository

Use the following:

hg clone http://hg.nuxeo.org/nuxeo
cd nuxeo
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-common
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-runtime
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-core
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-services
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-theme
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-webengine
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-jsf
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-gwt
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-features
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-dm
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-shell
hg clone http://hg.nuxeo.org/nuxeo/nuxeo-distribution

And if you need older versions of the 5.1 or 5.2 code:

hg clone http://hg.nuxeo.org/nuxeo/nuxeo-platform

please be sure to set correctly the branch for each repository

Updating your sources

Simply call in each repository:

hg pull -u

If, when you use this, you get a message like:

not updating, since new heads added
then you will have to call hg update manually in the appropriate repository.

Downloading the Nuxeo Apogee RCP sources

Use the following:

hg clone http://hg.nuxeo.org/nuxeo-apogee#2.0

Useful shell functions

These two shell functions ease working on Nuxeo Mercurial repositories. Add them to your .profile or .bashrc:

# Mercurial function that recurses all sub-directories containing a .hg directory and runs on them hg with given parameters
hgf() {
  for dir in . nuxeo-*; do
    if [ -d "$dir"/.hg ]; then
      echo "[$dir]"
      (cd "$dir" && hg "$@")
    fi
  done
}

# Mercurial function that recurse nuxeo sub-directories (nuxeo-common, nuxeo-core, etc.) and runs on them hg commands with given parameters.
# The two first parameters are mandatory and used to specify version; only one is used on each directory; 
# syntax is Reverse Polish Notation; 
# example: "hgx 5.1 1.4 heads" <=> "cd nuxeo-common; hg heads 1.4; (...); cd nuxeo-platform; hg heads 5.1; (...)"
hgx() {
  NXP=$1
  NXC=$2
  shift 2;
  if [ -d .hg ]; then
    echo $PWD
    hg $@ $NXP
    # NXC
    (echo nuxeo-common ; cd nuxeo-common; hg $@ $NXC || true)
    (echo nuxeo-runtime ; cd nuxeo-runtime; hg $@ $NXC || true)
    (echo nuxeo-core ; cd nuxeo-core; hg $@ $NXC || true)
    # NXP
    (echo nuxeo-theme ; cd nuxeo-theme; hg $@ $NXP || true)
    [ -d nuxeo-shell ] && (echo nuxeo-shell ; cd nuxeo-shell; hg $@ $NXP || true) || (echo ignore nuxeo-shell)
    [ -d nuxeo-platform ] && (echo nuxeo-platform ; cd nuxeo-platform && hg $@ $NXP || true) || (echo ignore nuxeo-platform)
    [ -d nuxeo-services ] && (echo nuxeo-services ; cd nuxeo-services && hg $@ $NXP || true) || (echo ignore nuxeo-services)
    [ -d nuxeo-jsf ] && (echo nuxeo-jsf ; cd nuxeo-jsf && hg $@ $NXP || true) || (echo ignore nuxeo-jsf)
    [ -d nuxeo-features ] && (echo nuxeo-features ; cd nuxeo-features && hg $@ $NXP || true) || (echo ignore nuxeo-features)
    [ -d nuxeo-dm ] && (echo nuxeo-dm ; cd nuxeo-dm && hg $@ $NXP || true) || (echo ignore nuxeo-dm)
    [ -d nuxeo-webengine ] && (echo nuxeo-webengine ; cd nuxeo-webengine; hg $@ $NXP || true) || (echo ignore nuxeo-webengine)
    [ -d nuxeo-gwt ] && (echo nuxeo-gwt ; cd nuxeo-gwt; hg $@ $NXP || true) || (echo ignore nuxeo-gwt)
    (echo nuxeo-distribution ; cd nuxeo-distribution; hg $@ $NXP || true)
  fi
}

Useful batch scripts for windows

The following code has to be placed in two files hgf.bat and hgx.bat, and created files should be placed in a folder present in %Path% to be directly accessible

hgf.bat

@echo off

set PWD=%CD%
echo [.]
hg %1

for /d %%D in (nuxeo-core nuxeo-common nuxeo-runtime nuxeo-platform nuxeo-distribution nuxeo-theme nuxeo-shell nuxeo-webengine nuxeo-gwt nuxeo-services nuxeo-jsf nuxeo-features nuxeo-dm) do (
echo [%%D]
cd %PWD%\%%D
hg %1
)

cd %PWD%

hgx.bat

@echo off

set PWD=%CD%
set NXP=%1
set NXC=%2

echo [.]
hg %3 %NXP%

for /d %%D in (nuxeo-platform nuxeo-distribution nuxeo-theme nuxeo-shell nuxeo-webengine nuxeo-gwt nuxeo-services nuxeo-jsf nuxeo-features nuxeo-dm) do (
echo [%%D]
cd %PWD%\%%D
hg %3 %NXP%
)

for /d %%D in (nuxeo-core nuxeo-common nuxeo-runtime) do (
echo [%%D]
cd %PWD%\%%D
hg %3 %NXC%
)

cd %PWD%

Example usage (some of these may be done using Forest):

hgf branches
hgf id
# switch working directory on 5.1
hgx 5.1 1.4 up -C
# create a branch for working on task NXP-XYZ-...
hgf branch NXP-XYZ-fix-applied-on-all-nuxeo
# do some work ...
# view changed files and then commit them
hgf st
hgf ci -m"NXP-XYZ ..."
# merge work on 5.1
hgx 5.1 1.4 up -C
hgf merge NXP-XYZ-fix-applied-on-all-nuxeo
hgf ci -m"merge NXP-XYZ on 5.1/1.4"
# merge 5.1 on 5.2
hgx 5.2 1.5 up -C
hgx 5.1 1.4 merge
hgf ci -m"merge 5.1/1.4 with NXP-XYZ on 5.2/1.5"
# see all outgoing changesets and push them
hgf out
hgf push
# or, to specifically push only modified branches
hgx 5.2 1.5 push -r
hgx 5.1 1.4 push -r
hgf push -r NXP-XYZ-fix-applied-on-all-nuxeo

PS: always be careful when pushing that there's no multiple heads (someone could have pushed changes just before your push tentative and next your last pull/update)

hgx 5.1 1.4 heads
hgx 5.2 1.5 heads

Using the Mercurial Forest Extension

Using the Mercurial Forest Extension helps when dealing with sub-projects. Here at Nuxeo we prefer to use the hgf and hgx shell functions that do almost the same thing as Forest in an even faster fashion. So this section about Forest is mainly kept for reference.

Installing the Mercurial Forest Extension

First you need to retrieve (download) the Mercurial Forest Extension. This will retrieve through mercurial the code you need in a ~/version/hg.akoha.org directory in your home directory. You can of course replace ~/version/hg.akoha.org by whatever you want.

mkdir -p ~/version/hg.akoha.org
cd hg.akoha.org
hg clone http://hg.akoha.org/hgforest/

Then you need to configure mercurial to use this extension. To do so, add the following lines in your ~/.hgrc :

[extensions]
hgext.forest=~/version/hg.akoha.org/hgforest/forest.py

Using Forest

To retrieve all the source code in one go:

hg fclone http://hg.nuxeo.org/nuxeo

But note that if you do that for Nuxeo 5.2, you will fetch nuxeo-platform, which is big and not used anymore in 5.2. This is one reason why we recommend not using forest.

To update the sources to the latest version, first fetch all changes in your local repository:

hg fpull

Then update your branch:

hg fup

For your first update after a fclone, the correct branch will not have been selected, you should switch explicitely to 1.5 (for nuxeo-common, nuxeo-runtime and nuxeo-core) and 5.2 (for the rest):

hg fup 1.5; hg fup 5.2
You can ignore warnings about unknown branches for the repositories that have the other one.

BEWARE:

hg fpull -u
has strange behavior and may not always update, prefer the two separate "fpull" then "fup" above.

Always check your current working version with:

hgf id
Note especially the branch shown in parentheses.
Version 59.1 last modified by Sun Seng David Tan on 05/06/2009 at 18:40

Comments 0

No comments for this document

Attachments 0

No attachments for this document

Creator: Florent Guillaume on 2008/03/23 16:07
© 2008-2009 Nuxeo
1.3.8295