Changeset 452 in ProjectBuilder for devel/pb/lib/ProjectBuilder/CMS.pm


Ignore:
Timestamp:
May 27, 2008, 1:46:52 AM (16 years ago)
Author:
Bruno Cornec
Message:
  • Make newproj action work again
  • Add pb_cms_add function
  • Change interface of pb_cms_checkin (third param)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/lib/ProjectBuilder/CMS.pm

    r448 r452  
    2929 
    3030our @ISA = qw(Exporter);
    31 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);
     31our @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_add);
    3232
    3333=pod
     
    336336The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
    337337The second parameter is the directory to update from.
     338The third parameter indicates if we are in a new version creation (undef) or in a new project creation (1)
    338339
    339340=cut
     
    342343my $scheme = shift;
    343344my $dir = shift;
     345my $pbinit = shift || undef;
    344346
    345347my $ver = basename($dir);
    346 if ($scheme =~ /^svn/) {
    347     pb_system("svn ci -m \"updated to $ver\" $dir","Checking in $dir");
     348my $msg = "updated to $ver";
     349$msg = "Project $ENV{PBPROJ} creation" if (defined $pbinit);
     350
     351if ($scheme =~ /^svn/) {
     352    pb_system("svn ci -m \"$msg\" $dir","Checking in $dir");
    348353} elsif ($scheme eq "flat") {
    349354} elsif ($scheme =~ /^cvs/) {
    350     pb_system("cvs ci -m \"updated to $ver\" $dir","Checking in $dir");
     355    pb_system("cvs ci -m \"$msg\" $dir","Checking in $dir");
    351356} else {
    352357    die "cms $scheme unknown";
    353358}
    354359pb_cms_up($scheme,$dir);
     360}
     361
     362=item B<pb_cms_add>
     363
     364This function adds to a CMS content from a local directory.
     365The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...)
     366The second parameter is the directory/file to add.
     367
     368=cut
     369
     370sub pb_cms_add {
     371my $scheme = shift;
     372my $f = shift;
     373
     374if ($scheme =~ /^svn/) {
     375    pb_system("svn add $f","Adding $f to SVN");
     376} elsif ($scheme eq "flat") {
     377} elsif ($scheme =~ /^cvs/) {
     378    pb_system("cvs add $f","Adding $f to CVS");
     379} else {
     380    die "cms $scheme unknown";
     381}
     382pb_cms_up($scheme,$f);
    355383}
    356384
Note: See TracChangeset for help on using the changeset viewer.