Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6d417e36f6bb1154f4c003e6717e298 > files > 137

a-a-p-1.090-2mdv2009.0.noarch.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 7. Version Control with CVS</title><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="A-A-P Recipe Executive"><link rel="up" href="tutorial.html" title="Part I. Tutorial"><link rel="prev" href="tutor-python.html" title="Chapter 6. Using Python"><link rel="next" href="tutor-actions.html" title="Chapter 8. Filetypes and Actions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table width="100%" id="navtable"><tbody><tr><td align="left" class="left" width="33%"><b><a href="http://www.a-a-p.org">A-A-P home page</a></b></td><td align="center" class="center" width="34%"><b><a href="index.html">A-A-P Recipe Executive</a></b></td><td align="right" class="right" width="33%"></td></tr><tr><td align="left" class="left"><a accesskey="p" href="tutor-python.html">Prev</a></td><td align="center" class="center">Tutorial</td><td align="right" class="right"><a accesskey="n" href="tutor-actions.html">Next</a></td></tr></tbody></table><hr><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="tutor-cvs"></a>Chapter 7. Version Control with CVS</h2></div></div></div><p>
CVS is often used for development of Open Source Software.
A-A-P provides facilities to obtain the latest version of an application and
for checking in changes you made.
</p><h2><a name="id2628626"></a>Downloading (Checkout)</h2><p>
For downloading a whole module you only need to specify the location of the
CVS server and the name of the module.  Here is an example that obtains the
A-A-P Recipe Executive:
</p><pre class="programlisting">
   CVSROOT = :pserver:anonymous@a-a-p.cvs.sourceforge.net:/cvsroot/a-a-p
   all:
        :fetch {fetch = cvs://$CVSROOT} Exec
</pre><p>
Write this recipe as "main.aap" and run <strong class="userinput"><code>aap</code></strong>.  The directory
"Exec" will be created and all files in the module obtained from the CVS
server:
</p><div class="literallayout"><p>    % <strong class="userinput"><code>aap</code></strong><br>
    Aap: CVS checkout for node "Exec"<br>
    Aap: cvs -d:pserver:anonymous@a-a-p.cvs.sf.net:/cvsroot/a-a-p checkout 'Exec'<br>
    cvs server: Updating Exec<br>
    U Exec/Action.py<br>
    U Exec/Args.py<br>
    [....]<br>
    %<br>
</p></div><p>
If there is a request for a password just hit enter (mostly there is no
password).
</p><p>
The <code class="computeroutput">:fetch</code> command takes care of obtaining the latest
version of the items mentioned as arguments.  Usually the argument is one
module, in this example it is "Exec".  That CVS needs to be used is
specified with the <code class="literal">fetch</code> attribute.  This is a kind of URL,
starting with "cvs://" and then the CVS root specification.  In the example
the <code class="literal">CVSROOT</code> variable was used.  This is not required, it just 
makes the recipe easier to understand.
</p><p>
If the software has been updated, you can get the latest version by running
"aap" again.  CVS will take care of obtaining the changed files.
</p><p>
Note that all this only works when you have the "cvs" command installed.
When it cannot be found <span class="application">Aap</span> will ask you want <span class="application">Aap</span> to install it for you.
Whether this works depends on your system.
</p><h2><a name="id2629997"></a>Getting Past A Firewall</h2><p>
Firewalls may block the use of a CVS connection.
Some servers have setup another way to connect, so that firewalls will not
cause problems.  This uses port 80, normally used for http connections.
Here is the above example using a different "pserver" address:
</p><pre class="programlisting">
   CVSROOT = :pserver:anonymous@a-a-p.cvs.sourceforge.net:/cvsroot/a-a-p
   all:
        :fetch {fetch = cvs://$CVSROOT} Exec
</pre><p>
This doesn't always work through a proxy though.  If you have problems
connecting to the CVS server, try reading the information at
<a href="http://sourceforge.net/docman/display_doc.php?docid=768&amp;group_id=1" target="_top">
this link</a>.
</p><h2><a name="id2630018"></a>Uploading (Checkin)</h2><p>
You are the maintainer of a project and want to distribute your latest
changes, so that others can obtain the software with a recipe as used above.
This means you need to checkin your files to the CVS server.  This is done by
listing the files that need to be distributed and giving them a
<code class="literal">commit</code> attribute.  Example:
</p><pre class="programlisting">
   CVSUSER_FOO = johndoe
   CVSROOT = :ext:$CVSUSER_FOO@cvs.foo.sf.net:/cvsroot/foo
   Files =  main.c
            common.h
            version.c
   :attr {commit = cvs://$CVSROOT} $Files
</pre><p>
Write this as "cvs.aap" and run <strong class="userinput"><code>aap -f cvs.aap revise</code></strong> .  What
will happen is:
</p><div class="orderedlist"><ol type="1"><li><p>
    Files that you changed since the last checkin will be checked in to the
    CVS server.
    </p></li><li><p>
    Files that you added to the list of files with a <code class="literal">commit</code>
    attribute will be added to the CVS module.
    </p></li><li><p>
    Files that you removed from the list of files with a <code class="literal">commit</code>
    attribute will be removed from the CVS module.
    </p></li></ol></div><p>
This means that you must take care the <code class="literal">Files</code> variable lists
exactly those files you want to appear in the CVS module, nothing more and
nothing less.  Be careful with using something like
<code class="computeroutput">*.c</code>, it might find more files that you intended.
</p><p>
Note: This only works when the CVS module was already setup.  Read the CVS
documentation on how to do this.  The A-A-P user manual has useful hints as
well.
</p><p>
In the example the <code class="literal">CVSUSER_FOO</code> variable is explicitly set, thus
this recipe only works for one user.  Better is to move this line to your own
default recipe, e.g., "~/.aap/startup/default.aap".  Then the above recipe
does not explicitly contain your user name and can also be used by others.
</p><p>
Once you tested this recipe and it works, you can easily distribute your
software with <strong class="userinput"><code>aap -f cvs.aap revise</code></strong>.  You don't have to worry
about the exact CVS commands to be used.  However, don't use this when you
want to checkin only some of the changes you made.  And the example does not
work well when others are also changing the same module.
</p><h2><a name="id2630187"></a>Further Reading</h2><p>
  The User manual <a href="user-version.html" title="Chapter 18. Version Control">Chapter 18, <i>Version Control</i></a> has more information about
  version control and <a href="user-cvs.html" title="Chapter 19. Using CVS">Chapter 19, <i>Using CVS</i></a> about using CVS.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tutor-python.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="tutorial.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="tutor-actions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 6. Using Python </td><td width="20%" align="center"><a accesskey="h" href="index.html">
		    Contents</a></td><td width="40%" align="right" valign="top"> Chapter 8. Filetypes and Actions</td></tr></table></div></body></html>