Renaming /doc to /docs for use with GitHub Pages
[jpf-core.git] / docs / install / repositories.md
1 # JPF Source Repository Access #
2
3 JPF sources are kept as [Mercurial](http://www.selenic.com/mercurial) repositories within the http://babelfish.arc.nasa.gov/hg/jpf directory. You need to clone the subrepositories (e.g. http://babelfish.arc.nasa.gov/hg/jpf/jpf-core) that you are interested in, **not** the root directory ../hg/jpf itself (which most likely will give you old subrepo revisions).
4
5 We provide anonymous, public read access. If you want to push your changes back to the repository, and you are not a NASA Ames employee, you need to [obtain a JPF contributor account](wiki:about/account).
6
7 Mercurial is a [Distributed Version Control System](http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/) (DVCS), like Git. If you are not familiar with this, it means "all repositories are created equal", and you have to read up a bit. The foremost authority is ["Mercurial: The Definite Guide"](http://hgbook.red-bean.com/).
8
9 For the inpatient, we also provide a short [Mercurial primer](../devel/mercurial).
10
11 ## Command Line Access ##
12
13 To check out the jpf-core use the mercurial command `clone`:
14
15 ~~~~~~~~ {.bash}
16 > cd ~/projects
17
18 > hg clone http://babelfish.arc.nasa.gov/hg/jpf/jpf-core
19 destination directory: jpf-core
20 requesting all changes
21 ...
22 added 71 changesets with 2045 changes to 1694 files
23 updating working directory
24 683 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 ~~~~~~~~
26
27 The same process can be repeating by substituting `jpf-core` with the [project](../projects/index) you are interested in. You can install the projects wherever you want, but you have to remember where you installed them for the subsequent [site.properties](../install/site-properties) configuration.
28
29 To update your local repository, change to its directory and do `pull` (don't forget the `-u` option, or your working directories will not get updated) 
30
31 ~~~~~~~~ {.bash}
32 > cd ~/projects/jpf-core
33 > hg pull -u
34 ~~~~~~~~
35
36 If you want - and are allowed - to push back your changes, you use **`https://`**`babelfish.arc.nasa.gov/hg/jpf/<project>` as the URL, which will require entering your user-name and password. Before pushing the changes you have to commit the changes from your working directory to your local repository. 
37
38 ~~~~~~~~ {.bash}
39 > cd ~/projects/jpf-core
40 > hg commit -m "this commits to the local repository"
41 ~~~~~~~~
42
43 The changes now can be pushed to the central repository using the following command
44
45 ~~~~~~~~ {.bash}
46 > hg push https://babelfish.arc.nasa.gov/hg/jpf/jpf-core
47 ~~~~~~~~
48
49 ## Mercurial Support within NetBeans ##
50
51 There is no need to install any plugins, NetBeans is distributed with Mercurial support.
52
53
54 ## Mercurial Plugin for Eclipse ##
55
56 To work within Eclipse
57
58 * Download and install the [MercurialEclipse](http://javaforge.com/project/HGE) plugin, which at the time of this writing is available from the update site: http://cbes.javaforge.com/update (the usual Eclipse spiel: **Help** -> **Install New Software...** -> **add site**, enter the update URL above) 
59
60 * In the eclipse menu: **File** -> **Import** -> **Mercurial** -> **Clone repository using Mercurial** -> **Next**
61
62 * In the repository location, URL, specify http://babelfish.arc.nasa.gov/hg/jpf/jpf-core
63
64 * Check the box for 'Search for .project files in clone and use them to create projects'
65
66 * Click on **Finish** 
67
68 The steps listed above will clone the repository in your workspace. Right clicking on the project will show a 'Team' option that allows to perform all the version control operations.