Difference between revisions of "Code repositories"

From MCEWiki
Line 1: Line 1:
= Repositories =
+
[[MAS]] and [[MCE script]] are housed in separate Subversion (SVN) repositories on <tt>e-mode.phas.ubc.ca</tt>, accessible from anywhere on the internet. The core MAS repository is called '''mas'''. The MCE script repository is called '''mce_script'''.
 
 
Currently, the MAS repository is on e-mode, and should be accessible from anywhere on the internet.  The svn server is <tt>e-mode.phas.ubc.ca</tt>.
 
 
 
There are separate repositories for core MAS (driver + libraries + command line applications) and user applications (squid tuning, file management scripts, idl scripts).
 
 
 
The core MAS repository is called "mas".
 
 
 
The MCE script repository is called "mce_script".
 
  
 +
<!--
 
== SSH Tunneling for SVN ==
 
== SSH Tunneling for SVN ==
  
Line 17: Line 10:
 
You can replace "mhasse@phas.ubc.ca" with your username@any machine behind the physics firewall that you have access to.  This command will ask for your password, and then remain open.  As long as this command is running, you can do svn operations using the address "svn://localhost/..." and they will be redirected to e-mode.
 
You can replace "mhasse@phas.ubc.ca" with your username@any machine behind the physics firewall that you have access to.  This command will ask for your password, and then remain open.  As long as this command is running, you can do svn operations using the address "svn://localhost/..." and they will be redirected to e-mode.
  
= Checkout =
+
-->
 +
== Checkout ==
  
== MAS ==
+
=== MAS ===
  
Everyone should be using mas/trunk these days.  In the past we suggested branching the MAS repository on a per-experiment basis, as is done for MCE script, but MAS is now stable enough that this is no longer necessary.  Only mas/trunk is currently maintained for Ubuntu 10.04.
+
Everyone should be using <tt>mas/trunk</tt> these days.  (In the past we suggested branching the MAS repository on a per-experiment basis, as is done for MCE script, but MAS is now stable enough that this is no longer necessary.) Only <tt>mas/trunk</tt> is currently maintained for Ubuntu 10.04 and 12.04.
  
Since MAS is a <tt>make/make install</tt> type of thing, you should checkout MAS into a user source folder somewhere:
+
MAS uses the GNU autotools for a bit of configuration work. You should checkout MAS into a user source folder somewhere:
  
 
  cd src/
 
  cd src/
  svn checkout --username=<my_svn_id or my_experiment_name> svn://e-mode.phas.ubc.ca/mas/trunk mas
+
  svn checkout --username=''<my_svn_id or my_experiment_name>'' svn://e-mode.phas.ubc.ca/mas/trunk mas
  
== MCE Script ==
+
=== MCE Script ===
  
 
The top-level structure of the mce_script repositories is, roughly:
 
The top-level structure of the mce_script repositories is, roughly:
Line 59: Line 53:
 
(You need to be in the <tt>mce</tt> group to get away with the checkout... 'usermod -a -G mce <username>' )
 
(You need to be in the <tt>mce</tt> group to get away with the checkout... 'usermod -a -G mce <username>' )
  
= Branching and merging =
+
== Branching and merging ==
  
== Branches ==
+
=== Branches ===
  
 
Individual MCE users don't usually get their own branches any more.  But here's how you'd do it:
 
Individual MCE users don't usually get their own branches any more.  But here's how you'd do it:
Line 74: Line 68:
 
Then check out your new branch.
 
Then check out your new branch.
  
== Merges ==
+
=== Merges ===
  
 
Merging is accomplished by telling svn to apply a change history from one branch into the current location.  For example, if we want branched from trunk/target at r100 and want to merge all changes in trunk/target up to the current head version into branches/expt/target, the merge command would be:
 
Merging is accomplished by telling svn to apply a change history from one branch into the current location.  For example, if we want branched from trunk/target at r100 and want to merge all changes in trunk/target up to the current head version into branches/expt/target, the merge command would be:

Revision as of 15:07, 16 May 2012

MAS and MCE script are housed in separate Subversion (SVN) repositories on e-mode.phas.ubc.ca, accessible from anywhere on the internet. The core MAS repository is called mas. The MCE script repository is called mce_script.

Checkout

MAS

Everyone should be using mas/trunk these days. (In the past we suggested branching the MAS repository on a per-experiment basis, as is done for MCE script, but MAS is now stable enough that this is no longer necessary.) Only mas/trunk is currently maintained for Ubuntu 10.04 and 12.04.

MAS uses the GNU autotools for a bit of configuration work. You should checkout MAS into a user source folder somewhere:

cd src/
svn checkout --username=<my_svn_id or my_experiment_name> svn://e-mode.phas.ubc.ca/mas/trunk mas

MCE Script

The top-level structure of the mce_script repositories is, roughly:

  --+--trunk
    +--branch--+--experiment1
               +--experiment2
               +-- ...

Depending on whether you want the trunk (UBC users or read-only for other users), or your experiment's branch, you should use either

 MY_BRANCH=trunk
 MY_USER=my_svn_id

or

 MY_BRANCH=branch/my_experiment_name
 MY_USER=my_experiment_name

If you have a personal svn id, you should use it. Sometimes.

Since things in mce_scripts tend to get edited more often than MAS, it should be checked-out directly into /usr/mce. The /usr/mce directory should be created automatically when you "sudo make install" the mas source. If you can't wait that long, create it manually:

sudo mkdir /usr/mce
sudo chgrp mce /usr/mce
sudo chmod g+wxs /usr/mce

Then checkout mce_script:

cd /usr/mce
svn checkout --username=$MY_USER svn://e-mode.phas.ubc.ca/mce_script/$MY_BRANCH  mce_script

(You need to be in the mce group to get away with the checkout... 'usermod -a -G mce <username>' )

Branching and merging

Branches

Individual MCE users don't usually get their own branches any more. But here's how you'd do it:

svn checkout svn://e-mode.phas.ubc.ca/mce_script
svn copy mce_script/trunk mce_script/branch/{your_project_name}
svn commit mce_script

Alternately, do the copy directly on the svn server (it is automatically committed):

svn copy svn://e-mode.phas.ubc.ca/mce_script/trunk svn://e-mode.phas.ubc.ca/mce_script/branch/{your_project_name}

Then check out your new branch.

Merges

Merging is accomplished by telling svn to apply a change history from one branch into the current location. For example, if we want branched from trunk/target at r100 and want to merge all changes in trunk/target up to the current head version into branches/expt/target, the merge command would be:

cd branches/expt/target
svn merge -r100:HEAD ../../../trunk/target