The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

VcsTools::RcsAgent - Perl class to manage ONE RCS files..

SYNOPSIS

 my $h = new VcsTools::RcsAgent 
  (
   name => $file,
   trace => $trace,
   workDir => $ENV{'PWD'}
  );

 $h -> getHistory() ;

 $h -> checkOut(revision => '1.51.1.1', lock => 1) ;

 $h -> getContent(revision => '1.52') ;

 $h -> checkArchive() ;

 $h -> changeLock(lock => 1,revision => '1.51.1.1' ) ;

 $h -> archiveLog(log => "new dummy\nhistory\n",
                     state => 'Dummy', revision => '1.52') ;

 $h -> showDiff(rev1 => '1.41') ;

 $h -> showDiff(rev1 => '1.41', rev2 => '1.43') ;

 $h -> checkIn(revision => '1.52', 
              'log' => "dummy log\Nof a file\n") ;

DESCRIPTION

This class is used to manage a RCS file. All functions are executed in blocking mode.

If you want to use other VCS system than RCS, you should copy or inherit this file to implement your own new class.

Contructor

new(...)

Creates a new RCS agent class. Note that one RcsAgent must be created for each RCS file.

Parameters are :

  • name: file name (mandatory)

  • workDir: local directory where the file is.

  • trace: If set to 1, debug information are printed.

  • test: each command will return the command to be executed instead of the command result.

Methods

checkOut(...)

Parameters are :

  • revision: file revision to check out.

  • lock: boolean. whether to lock the file or not.

Checks out revision x.y and lock it if desired.

Returns an array ref containing the output of the 'ci' in case of success, undef in case of problems.

In case of problem, you can call the error() method to get the STDOUT of the command.

getContent(...)

Parameters are :

  • revision: file revision to check out.

Get the content of file revision x.y.

Returns an array ref of the file content in case of success, undef in case of problems.

In case of problem, you can call the error() method to get the STDOUT of the command.

checkArchive()

Check the state of the archive with respect to the passed revision.

Parameters are :

  • revision: revision number of the user's working file. May be undef.

Returns an array ref made of [$rev,$locker,$time] or undef in case of problems.

  • $time is the time of the last modification of the archive (in epoch, decimal time)

  • if the revision the the user is working is locked, $locker returns the name of the locker, 'unlocked' otherwise.

  • $revision is there for historical reasons. It returns the revision number of the user's working file if this rev is locked. Is undef otherwise.

changeLock(...)

Parameters are :

  • revision: file revision to check out.

  • lock: whether to lock the file or not.

Change the lock of the file for revision x.y.

Returns an array ref containing the output of the 'rcs' in case of success, undef in case of problems.

In case of problem, you can call the error() method to get the STDOUT of the command.

archiveLog(...)

Will modify the log (not the file) of a specified revision of the file.

Parameters are :

  • revision

  • log: log to store in the history of revision

  • state: new state to store

Returns an array ref containing the output of the 'futil' in case of success, undef in case of problems.

In case of problem, you can call the error() method to get the STDOUT of the command.

getHistory()

Gets the complete history of file.

Returns an array ref containing the history in case of success, undef in case of problems.

In case of problem, you can call the error() method to get the STDOUT of the command.

showDiff(...)

Parameters are :

  • rev1: first revision to compare

  • rev2: 2nd revision to compare. If not specified, the comparison is made between the local file and revision 'rev1'.

Gets the diff between current file and revision rev1 or between rev1 and rev2 if rev2 is specified.

Returns an array ref containing the diff output in case of success, undef in case of problems.

In case of problem, you can call the error() method to get the STDOUT of the command.

create()

Create the RCS file.

Returns an array ref containing the output of the 'ci' commmand in case of success, undef in case of problems.

In case of problem, you can call the error() method to get the STDOUT of the command.

checkIn(...)

Archive (check in) the current file. Parameters are :

  • revision

  • log: log to store in the history of revision

Returns an array ref containing the output of the 'ci' commmand in case of success, undef in case of problems.

In case of problem, you can call the error() method to get the STDOUT of the command.

AUTHOR

Dominique Dumont, Dominique_Dumont@grenoble.hp.com

Copyright (c) 1998-1999 Dominique Dumont. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

perl(1), VcsTools::Process(3)