NAME

VcsTools::HmsAgent - Perl class to manage ONE HMS files..

SYNOPSIS

my $h = new VcsTools::HmsAgent 
 (
  hmsBase => 'test_integ',
  hmsHost => 'hptnofs',
  name => $file,
  trace => $trace,
  workDir => $some_dir
 );

$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 HMS file. All functions are executed in blocking mode.

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

HMS

HMS is Hewlett-Packard proprietary VCS system based on RCS. This product is part of HP SoftCM.

Contructor

new(...)

Creates a new HMS agent class. Note that one HmsAgent must be created for each HMS file.

Parameters are :

  • name: file name (mandatory)

  • hmsHost: Specify the HMS server name.

  • hmsBase: Specify the HMS base name.

  • hmsDir: Specify the directory relative to the HMS base where the file is archived.

  • 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.

If 'hmsHost' or 'hmsBase' parameters are not provided, HMS will rely on the system or user .fmrc file. See fci(1) for more details.

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 'fci' 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 on is locked, $locker returns the name of the locker, 'unlocked' otherwise.

  • $revision is there for historical reasons. It is set to the revision number of the user's working file if this revision is locked. set to 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 '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.

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 HMS file. If needed this method will also create the HMS path in the HMS base.

Returns an array ref containing the output of the 'fci' 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 'fci' 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.

list()

Returns a hash reference containing all HMS files found in the HMS base in the directory of this file and all sub-directories (i.e list recursively all files found in and below /hmsBase/hmsDir).

The hash will contains the locker and locked revision (if any) and the last modification time of the HMS archive.

For instance, list will return : {'foo' => {rev => '1.0', locker => 'bob', time => '935143309'}, 'subdir/bar' => {rev => undef , locker => undef, time => '935143305'}}

Returns undef in case of problem.

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)