Index: devel/pb/lib/ProjectBuilder/CMS.pm
===================================================================
--- devel/pb/lib/ProjectBuilder/CMS.pm	(revision 405)
+++ devel/pb/lib/ProjectBuilder/CMS.pm	(revision 409)
@@ -29,5 +29,5 @@
  
 our @ISA = qw(Exporter);
-our @EXPORT = qw(pb_cms_init pb_cms_export pb_cms_get_uri pb_cms_copy pb_cms_checkout pb_cms_up pb_cms_checkin pb_cms_isdiff pb_cms_get_pkg pb_cms_compliant pb_cms_log pb_cms_create_authors);
+our @EXPORT = qw(pb_cms_init pb_cms_export pb_cms_get_uri pb_cms_copy pb_cms_checkout pb_cms_up pb_cms_checkin pb_cms_isdiff pb_cms_get_pkg pb_cms_compliant pb_cms_log);
 
 =pod
@@ -35,5 +35,5 @@
 =head1 NAME
 
-ProjectBuilder::CMS, part of the project-builder.org - module dealing with configuration management system functions suitable for pbinit calls.
+ProjectBuilder::CMS, part of the project-builder.org
 
 =head1 DESCRIPTION
@@ -41,7 +41,16 @@
 This modules provides configuration management system functions suitable for pbinit calls.
 
-=cut
-
-# Setup environment for CMS system for URL passed
+=head1 USAGE
+
+=over 4
+
+=item B<pb_cms_init>
+
+This function setup the environment for the CMS system related to the URL given by the pburl configuration parameter.
+The potential parameter indicates whether we should inititate the context or not.
+It sets up environement variables (PBPROJDIR, PBDIR, PBREVISION, PBCMSLOGFILE) 
+
+=cut
+
 sub pb_cms_init {
 
@@ -95,4 +104,13 @@
 return($scheme,$pburl->{$ENV{'PBPROJ'}});
 }
+
+=item B<pb_cms_export>
+
+This function exports a CMS content to a directory.
+The first parameter is the URL of the CMS content.
+The second parameter is the directory in which it is locally exposed (result of a checkout).
+The third parameter is the directory where we want to deliver it (result of export).
+
+=cut
 
 sub pb_cms_export {
@@ -186,5 +204,12 @@
 }
 
-# This function is only called with a real CMS system
+=item B<pb_cms_get_uri>
+
+This function is only called with a real CMS system and gives the URL stored in the checked out directory.
+The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
+The second parameter is the directory in which it is locally exposed (result of a checkout).
+
+=cut
+
 sub pb_cms_get_uri {
 
@@ -234,4 +259,15 @@
 }
 
+=item B<pb_cms_copy>
+
+This function copies a CMS content to another.
+The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
+The second parameter is the URL of the original CMS content.
+The third parameter is the URL of the destination CMS content.
+
+Only coded for SVN now.
+
+=cut
+
 sub pb_cms_copy {
 my $scheme = shift;
@@ -248,4 +284,13 @@
 }
 
+=item B<pb_cms_checkout>
+
+This function checks a CMS content out to a directory.
+The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
+The second parameter is the URL of the CMS content.
+The third parameter is the directory where we want to deliver it (result of export).
+
+=cut
+
 sub pb_cms_checkout {
 my $scheme = shift;
@@ -264,4 +309,12 @@
 }
 
+=item B<pb_cms_up>
+
+This function updates a local directory with the CMS content.
+The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
+The second parameter is the directory to update.
+
+=cut
+
 sub pb_cms_up {
 my $scheme = shift;
@@ -272,8 +325,17 @@
 } elsif ($scheme eq "flat") {
 } elsif ($scheme =~ /^cvs/) {
-} else {
-	die "cms $scheme unknown";
-}
-}
+	pb_system("cvs up $dir","Updating $dir");
+} else {
+	die "cms $scheme unknown";
+}
+}
+
+=item B<pb_cms_checkin>
+
+This function updates a CMS content from a local directory.
+The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
+The second parameter is the directory to update from.
+
+=cut
 
 sub pb_cms_checkin {
@@ -286,4 +348,5 @@
 } elsif ($scheme eq "flat") {
 } elsif ($scheme =~ /^cvs/) {
+	pb_system("cvs ci -m \"updated to $ver\" $dir","Checking in $dir");
 } else {
 	die "cms $scheme unknown";
@@ -291,4 +354,12 @@
 pb_cms_up($scheme,$dir);
 }
+
+=item B<pb_cms_isdiff>
+
+This function returns a integer indicating the number f differences between the CMS content and the local directory where it's checked out.
+The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
+The second parameter is the directory to consider.
+
+=cut
 
 sub pb_cms_isdiff {
@@ -318,7 +389,12 @@
 }
 
-# 
-# Return the list of packages we are working on in a CMS action
-#
+=item B<pb_cms_isdiff>
+
+This function returns the list of packages we are working on in a CMS action.
+The first parameter is the default list of packages from the configuration file.
+The second parameter is the optional list of packages from the configuration file.
+
+=cut
+
 sub pb_cms_get_pkg {
 
@@ -340,7 +416,15 @@
 }
 
-#
-# Check pbconf/project cms compliance
-#
+=item B<pb_cms_compliant>
+
+This function checks the compliance of the project and the pbconf directory.
+The first parameter is the key name of the value that needs to be read in the configuration file.
+The second parameter is the environment variable this key will populate.
+The third parameter is the location of the pbconf dir.
+The fourth parameter is the URI of the CMS content related to the pbconf dir.
+The fifth parameter indicates whether we should inititate the context or not.
+
+=cut
+
 sub pb_cms_compliant {
 
@@ -403,4 +487,13 @@
 }
 
+=item B<pb_cms_create_authors>
+
+This function creates a AUTHORS files for the project. It call it AUTHORS.pb if an AUTHORS file already exists.
+The first parameter is the source file for authors information.
+The second parameter is the directory where to create the final AUTHORS file.
+The third parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
+
+=cut
+
 sub pb_cms_create_authors {
 
@@ -411,5 +504,5 @@
 return if ($authors eq "/dev/null");
 open(SAUTH,$authors) || die "Unable to open $authors";
-# Save a potentially existing AUTHORS file and write instead toi AUTHORS.pb 
+# Save a potentially existing AUTHORS file and write instead to AUTHORS.pb 
 my $ext = "";
 if (-f "$dest/AUTHORS") {
@@ -438,4 +531,18 @@
 }
 
+=item B<pb_cms_log>
+
+This function creates a ChangeLog file for the project.
+The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
+The second parameter is the directory where the CMS content was checked out.
+The third parameter is the directory where to create the final ChangeLog file.
+The fourth parameter is unused.
+The fifth parameter is the source file for authors information.
+
+It may use a tool like svn2cl or cvs2cl to generate it if present, or the log file from the CMS if not.
+
+=cut
+
+
 sub pb_cms_log {
 
@@ -483,3 +590,24 @@
 }
 
+=back 
+
+=head1 WEB SITES
+
+The main Web site of the project is available at L<http://www.project-builder.org/>. Bug reports should be filled using the trac instance of the project at L<http://trac.project-builder.org/>.
+
+=head1 USER MAILING LIST
+
+None exists for the moment.
+
+=head1 AUTHORS
+
+The Project-Builder.org team L<http://trac.project-builder.org/> lead by Bruno Cornec L<mailto:bruno@project-builder.org>.
+
+=head1 COPYRIGHT
+
+Project-Builder.org is distributed under the GPL v2.0 license
+described in the file C<COPYING> included with the distribution.
+
+=cut
+
 1;
