Difference between revisions of "ADempiere Version Control"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
m (Creating local working clones)
(Summary Instructions)
 
(41 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<font color="red"> '''Note: This is a Draft Document - work-in-progress''' </font>
+
{{Breadcrumb|Table_of_Contents#Developer.27s_Guide|next=Create your ADempiere development environment}}
 +
[[Category:Table of Contents]]
 +
[[Category:Developer documentation]]
 +
{{Note|As of Release 380, 15 January 2015, the main ADempiere repository has moved to GitHub along with the entire history of the main branches.  This document described the process of working with GitHub as well as the instructions for SourceForge. The page will be a work in progress for a few days.}}
  
==Installing Mercurial==
+
= The ADempiere Project Repository =
 +
The main repository for ADempiere can be found on the GitHub site at [https://github.com/adempiere/adempiere https://github.com/adempiere/adempiere].
  
===Install Mercurial client===
+
Before proceeding, please refer to the [http://git-scm.com/doc Git SCM Documentation].
  
* Follow the instructions at: http://mercurial.selenic.com/downloads/
+
To collaborate with the ADempiere team, we use the git '''FORK''' and '''PULL''' model. From the [https://help.github.com/articles/using-pull-requests/#fork--pull GitHub website]:
  
* Set your username in the Mercurial configuration file.
+
<blockquote>The fork & pull model lets anyone fork an existing repository and push changes to their personal fork without requiring access be granted to the source repository. The changes must then be pulled into the source repository by the project maintainer. This model reduces the amount of friction for new contributors and is popular with open source projects because it allows people to work independently without upfront coordination.</blockquote>
** 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]
+
Refer to the GitHub article on [https://help.github.com/articles/using-pull-requests Pull Requests] for more information and instructions on how to get started.
  username = Tony Snook <tspc at dodo.com.au>
+
  
===Install Mercurcial Eclipse plug-in===
+
== Summary Instructions ==
 +
The setup is easy.  Follow these steps:
 +
* '''Install the Git Software.'''  You can work with the Git command line or any of a number of Git GUI tools. As the repository is on GitHub, it is recommended to follow the [https://help.github.com/articles/set-up-git/ GitHub setup procedures].
 +
* Create a GitHub account
 +
* [https://help.github.com/articles/fork-a-repo/ Create your personal fork] of the ADempiere project
 +
* Create a local clone of your personal fork
 +
* Follow the instructions in [[Create your ADempiere development environment]], [[Creating WebUI Workspace using Eclipse Webtool]] and [[Create your ADempiere customization environment]].
 +
* Start developing!
 +
* Commit your work to your own fork.  Follow the ADempiere [[Software Development Procedure]] for branch naming.
 +
* Send a pull request to the ADempiere project.
  
* 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
+
=== Cloning a Repository ===
  
* '''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.
+
Cloning a repository to your local computer is simple.  Follow the instructions with the GitHub software or your GUI tool, many of which allow for cloning a GitHub repository to a local computer with a few mouse clicks. If you want to do it from the command line,
  
* Information about the plug-in can be found at: http://www.javaforge.com/project/HGE
+
# Navigate to the parent directory where the repository will be placed and type the following command
 +
C:\dev\repos\github>git clone [url]
  
==Cloning SourceForge repositories==
+
This will create a directory using the url project name, initialize a .git directory inside it, pull down all the data for that repository, and check out a working copy of the latest version. If you go into the new directory, you’ll see the project files in there, ready to be worked on or used.
  
===Available Mercurial repositories===
+
To change the name of clone directory use the following
  
* There are currently 4 mercurial repositories: adempiere, contributions, eevolution and localizations.
+
# Navigate to the parent directory where the repository will be placed and type the following command
** The repositories can be browsed from:
+
C:\dev\repos\github>git clone [url] <optional name>
http://adempiere.hg.sourceforge.net/hgweb/adempiere
+
  
* A list of mappings from SVN folders to Mercurial repositories and branches can be found at:
+
=== Cloning the Repository with a Slow Connection ===
http://spreadsheets.google.com/ccc?key=0AsDcKifVZoKvdGFRVHo0bE1NVFBfRWZjLU55bkFGVFE&hl=en
+
  
===Creating the local pristine clones===
+
To clone a repository over a slow or intermittent Internet connection, try using git fetch instead of clone as follows:
  
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.
+
# Create a directory for the repo and change to it
 +
C:\dev\repos\github>mkdir adempiere
 +
 +
C:\dev\repos\github>cd adempiere
 +
 +
# Initialize the repository
 +
C:\dev\repos\github\adempiere>git init
 +
Initialized empty Git repository in C:/dev/repos/github/adempiere/.git/
 +
 +
# The default reference to the source repository in a clone is "origin".  Clone your
 +
# personal fork from your account <account>.
 +
C:\dev\repos\github\adempiere>git remote add origin https://github.com/<account>/adempiere.git
 +
 +
# Fetch the contents.
 +
C:\dev\repos\github\adempiere>git fetch
 +
 +
# Update to the current master branch - for example
 +
C:\dev\repos\github\adempiere>git reset --hard origin/master
  
In the Mercurial terminology this is called a clone. A clone is a copy of a repository in a new directory.
+
[[category:developer documentation]]
 
+
[[Category: Technical Team]] [[Category: Functional Team]]
* 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 <nowiki>http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/adempiere</nowiki> adempiere
+
 
+
* Clone any additional repositories you require, for example:
+
 
+
* Contributions repository:
+
  cd /opt/repos/sourceforge
+
  hg clone -U <nowiki>http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/contributions</nowiki> 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 <nowiki>http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/eevolution#libero</nowiki> 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.
+
 
+
 
+
==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 cd /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
+
 
+
Then, 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===
+
TBA
+
 
+
 
+
===References===
+
 
+
For more information about Mercurial:
+
    * The [http://www.selenic.com/mercurial/wiki/ Mercurial wiki].
+
    * The [http://hgbook.red-bean.com/ hgbook:] Mercurial: The Definitive Guide.
+
    * Cheat sheets: http://www.selenic.com/mercurial/wiki/index.cgi/QuickReferenceCardsAndCheatSheets
+
    * The [http://www.selenic.com/mercurial/wiki/index.cgi/FAQ Mercurial FAQ].
+
    * [http://wiki.netbeans.org/HgMigrationDocs HgMigrationDocs] from NetBeans Wiki.
+
    * [http://wiki.openbravo.com/wiki/Mercurial_Manual_for_Openbravo_Developers 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
+

Latest revision as of 02:03, 14 March 2016

Table_of_Contents#Developer.27s_Guide{{#if: | | [[{{{2}}}]] }}{{#if: | | [[{{{3}}}]] }}{{#if: | | [[{{{4}}}]] }}{{#if: | | [[{{{5}}}]] }} | ADempiere Version Control{{#if: Create your ADempiere development environment| | Create your ADempiere development environment }} ⇒

Note.gif Note:

As of Release 380, 15 January 2015, the main ADempiere repository has moved to GitHub along with the entire history of the main branches. This document described the process of working with GitHub as well as the instructions for SourceForge. The page will be a work in progress for a few days.

The ADempiere Project Repository

The main repository for ADempiere can be found on the GitHub site at https://github.com/adempiere/adempiere.

Before proceeding, please refer to the Git SCM Documentation.

To collaborate with the ADempiere team, we use the git FORK and PULL model. From the GitHub website:

The fork & pull model lets anyone fork an existing repository and push changes to their personal fork without requiring access be granted to the source repository. The changes must then be pulled into the source repository by the project maintainer. This model reduces the amount of friction for new contributors and is popular with open source projects because it allows people to work independently without upfront coordination.

Refer to the GitHub article on Pull Requests for more information and instructions on how to get started.

Summary Instructions

The setup is easy. Follow these steps:

Cloning a Repository

Cloning a repository to your local computer is simple. Follow the instructions with the GitHub software or your GUI tool, many of which allow for cloning a GitHub repository to a local computer with a few mouse clicks. If you want to do it from the command line,

# Navigate to the parent directory where the repository will be placed and type the following command
C:\dev\repos\github>git clone [url]

This will create a directory using the url project name, initialize a .git directory inside it, pull down all the data for that repository, and check out a working copy of the latest version. If you go into the new directory, you’ll see the project files in there, ready to be worked on or used.

To change the name of clone directory use the following

# Navigate to the parent directory where the repository will be placed and type the following command
C:\dev\repos\github>git clone [url] <optional name>

Cloning the Repository with a Slow Connection

To clone a repository over a slow or intermittent Internet connection, try using git fetch instead of clone as follows:

# Create a directory for the repo and change to it
C:\dev\repos\github>mkdir adempiere

C:\dev\repos\github>cd adempiere

# Initialize the repository
C:\dev\repos\github\adempiere>git init
Initialized empty Git repository in C:/dev/repos/github/adempiere/.git/

# The default reference to the source repository in a clone is "origin".  Clone your
# personal fork from your account <account>.
C:\dev\repos\github\adempiere>git remote add origin https://github.com/<account>/adempiere.git

# Fetch the contents.
C:\dev\repos\github\adempiere>git fetch

# Update to the current master branch - for example
C:\dev\repos\github\adempiere>git reset --hard origin/master