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.
(See Also)
(Summary Instructions)
 
(31 intermediate revisions by 7 users not shown)
Line 1: Line 1:
==Installing Mercurial==
+
{{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.}}
  
===Install Mercurial client===
+
= 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].
  
* Follow the instructions at:  http://mercurial.selenic.com/downloads/
+
Before proceeding, please refer to the [http://git-scm.com/doc Git SCM Documentation].
  
* Set your username in the Mercurial configuration file.
+
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]:
** 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]
+
<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>
  username = Tony Snook <tspc at dodo.com.au>
+
  
===Install Mercurcial Eclipse plug-in===
+
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.
  
* 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
+
== 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.
  
* '''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 ===
  
* Information about the plug-in can be found at: http://www.javaforge.com/project/HGE
+
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,
  
==Cloning SourceForge repositories==
+
# Navigate to the parent directory where the repository will be placed and type the following command
 +
C:\dev\repos\github>git clone [url]
  
===Available Mercurial 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.
  
* There are currently 4 mercurial repositories: adempiere, contributions, eevolution and localizations.
+
To change the name of clone directory use the following
** 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:
+
# Navigate to the parent directory where the repository will be placed and type the following command
http://spreadsheets.google.com/ccc?key=0AsDcKifVZoKvdGFRVHo0bE1NVFBfRWZjLU55bkFGVFE&hl=en
+
C:\dev\repos\github>git clone [url] <optional name>
  
===Creating the local pristine clones===
+
=== Cloning the Repository with a Slow Connection ===
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.
+
To clone a repository over a slow or intermittent Internet connection, try using git fetch instead of clone as follows:
  
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.
+
# Create a directory for the repo and change to it
 
+
  C:\dev\repos\github>mkdir adempiere
* First create a directory for your cloned SourceForge repositories:
+
** For example:  /opt/repos/sourceforge
+
C:\dev\repos\github>cd adempiere
 
+
* To make a clone of the main ADempiere repository.
+
# Initialize the repository
  cd /opt/repos/sourceforge
+
C:\dev\repos\github\adempiere>git init
  hg clone -U <nowiki>http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/adempiere</nowiki> adempiere
+
Initialized empty Git repository in C:/dev/repos/github/adempiere/.git/
 
+
* Clone any additional repositories you require, for example:
+
# The default reference to the source repository in a clone is "origin". Clone your
 
+
  # personal fork from your account <account>.
* Contributions repository:
+
  C:\dev\repos\github\adempiere>git remote add origin https://github.com/<account>/adempiere.git
  cd /opt/repos/sourceforge
+
   
  hg clone -U <nowiki>http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/contributions</nowiki> contributions
+
  # Fetch the contents.
 
+
  C:\dev\repos\github\adempiere>git fetch
* If you just want to clone a single branch of a repository, say the Libero branch of the eevolution repository:
+
  cd /opt/repos/sourceforge
+
  # Update to the current master branch - for example
  hg clone -U <nowiki>http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/eevolution#libero</nowiki> libero
+
C:\dev\repos\github\adempiere>git reset --hard origin/master
 
+
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 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
+
 
+
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 [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]
+
 
+
==See Also==
+
*[[Converting from SVN to Mercurial]]
+
*[[Talk:Mercurial Test Environment|A MacBook experience by [[User:Red1|Redhuan D. Oon]]]]
+
  
 
[[category:developer documentation]]
 
[[category:developer documentation]]
 +
[[Category: Technical Team]] [[Category: Functional Team]]

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