Author image William J. Middleton

NAME

VCS::PVCS::Commands - Command class for for VCS::PVCS

SYNOPSIS

  use VCS::PVCS::Project;

  $proj = new VCS::PVCS::Project("ProjectName");

# Operate on every member in the project

    $proj->checkout("-V 1.7 -Y");
    $proj->checkin("-A foo,bar,baz -V 1.7");
    $proj->vlog("-BG foo");
    $proj->lock("mylabel");
    $proj->addFloatingVersionLabel("mylabel6");

# OR

# Operate on every archive in each folder

  $proj = new VCS::PVCS::Project("ProjectName");
  $folds = $proj->openFolders(".*");

  foreach $f (@$folds){
    $f->co("-Y -P -V 1.7");
    if(! $PVCSERR){
     $f->put("-A foo,bar,baz -V 1.7");
    }
    else{
      print $PVCSOUTPUT;
    }
    $f->put("-A foo,bar,baz -V 1.7");
    $f->history("-D 071363-091298");
    $f->unlock("1.7" );
    $f->addVersionLabel("mylabel2");
  }

# OR

# Operate on the projects archive objects separately

  $proj = new VCS::PVCS::Project("ProjectName");
  $members = $proj->members(".*");

  foreach $f (@$members){
    $f->co("-Y -P -V 1.7",$f->archive());

    if(! $PVCSERR){
      $f->put("-A foo,bar,baz -V 1.7 /path/to/archive.c_v");
    }
    else{
      print $PVCSOUTPUT;
    }
    $f->put("-A foo,bar,baz -V 1.7",$f->archive());
    $f->history("-D 071363-091298",$f->archive());
    $f->unlock("1.7" ,$f->archive());
    $f->addVersionLabel("mylabel2",$f->archive());
  }

# OR

# Operate on the folder's archive objects separately

  $folds = $proj->openFolders(".*");

  foreach $folder (@$folds){
    $members = $folder->members(".*");
    foreach $f (@$members){
      $f->co("-Y -P -V 1.7",$f->archive());
      if(! $PVCSERR){
        put("-A foo,bar,baz -V 1.7 /path/to/archive.c_v");
      }
      else{
        print $PVCSOUTPUT;
      }
      $f->co("-Y -P -V 1.7",$f->archive());
      $f->put("-A foo,bar,baz -V 1.7",$f->archive());
      $f->history("-D 071363-091298",$f->archive());
      $f->unlock("1.7" ,$f->archive());
      $f->addVersionLabel("mylabel2",$f->archive());
    }
  }

# OR

# Simple use of only this module

  use VCS::PVCS;   # You must still use the master module
  use VCS::PVCS::Commands qw(:all);

# You MUST set these when using Commands by itself $VCS::PVCS::PVCSMASTERCFG = "../../MASTER.CFG"; $VCS::PVCS::PVCSCURRPROJCFG = "../../examples.cfg";

# Note the arguments may be all in one string, or separated by quotes

  checkout("-L","-V 1.7","-Y", "/path/to/archive.c_v");
  if(! $PVCSERR){
    put("-A foo,bar,baz -V 1.7 /path/to/archive.c_v");
  }
  else{
    print $PVCSOUTPUT;
  }

DESCRIPTION

Each time a command is run, the global values $PVCSERR and $PVCSOUTPUT get set to errno and output respectively.

This class can be used directly. But it is intended for use as an ISA for VCS::PVCS::* classes. Folder, Project, and Archive objects inherit Command methods, and augment them, to implement the appropriate actions on each type of object.

You MUST set the $VCS::PVCS::PVCSMASTERCFG and the $VCS::PVCS::PVCSCURRPROJCFG to be the master configuration file, and the project configuration file, respectively, when using this module by itself.

If you wish to use this module directly, the Exporter makes most of the symbols available when you use VCS::PVCS. You should see the test cases and the sample code above for more details.

METHODS

get
  get([get opts] file(s));
checkout

Convenience routine calls get();

co

Convenience routine calls get();

put
  put([put opts] file(s));

Checkin the named file.

checkin

Convenience routine calls put();

ci

Convenience routine calls put();

vdiff
  vdiff([vdiff opts]);
vlog
  vlog([vlog opts]);
log

Convenience routine calls vlog();

history

Convenience routine calls vlog();

lock
  lock([vcs opts] files)';

Lock the named archive file(s).

unlock
  unlock([$label | $version],[vcs opts],file(s));

Unlock the named files.

addVersionLabel
  addVersionLabel(label,[vcs opts],file(s));

Add a version label to the named archive file(s).

deleteVersionLabel
  deleteVersionLabel(label,[vcs opts],file(s));

Delete a version label to the named archive file(s).

replaceVersionLabel
  replaceVersionLabel($newlabel,$oldlabel,[vcs opts],files);

Delete a version label to the named archive file(s).

transformVersionLabel
  transformVersionLabel(label,[vcs opts],file(s));

Transform a version label to floating for the named archive file(s).

addFloatingVersionLabel
  addFloatingVersionLabel(label,[vcs opts],file(s));

Create a floating version label for the named archive file(s).

deletePromoGroup
  deletePromoGroup($group,[vcs opts],file(s))';

Delete the promotion group from the archive

addPromoGroup
  addPromoGroup(group:$rev,[vcs opts],files(s))';

Add the promotion group to the archive (at rev)

createArchive
  createArchive([vcs opts],file(s))';

Create a new archive in $file.

vcs
  vcs([opts][files])';

Run vcs by itself.

AUTHOR

Bill Middleton, wjm@metronet.com

COPYRIGHT

The PVCS module is Copyright (c) 1998 Bill Middleton. All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

SUPPORT / WARRANTY

The VCS::PVCS modules are free software.

THEY COME WITHOUT WARRANTY OF ANY KIND.

Commercial support agreements for Perl can be arranged via The Perl Clinic. See http://www.perl.co.uk/tpc for more details.

SEE ALSO

VCS::PVCS::Project