NAME

VcsTools::HmsAgent - Perl class to manage HMS serve.

SYNOPSIS

my $h = new VcsTools::HmsAgent (
                               processClass => 'dummyP',
                               hmsHost => 'hptnofs',
                               hmsDir =>'adir',
                               hmsBase => 'abase',
                               hmsHost => 'hptnofs',
                               name => 'dummy.txt',
                               trace => $trace,
                               workDir => $ENV{'PWD'}
                              );

$h -> getLog(callback => \&cb) ;

$h -> checkOut(callback => \&cb, revision => '1.51.1.1', lock => 1) ;

$h -> getContent(callback => \&cb, revision => '1.52') ;

$h -> checkLock(callback => \&lockCb) ;

$h -> changeLock(callback => \&cb, lock => 1,revision => '1.51.1.1' ) ;

$h -> archiveHistory(callback => \&cb, str => "new dummy\nhistory\n",
                    state => 'Dummy', revision => '1.52') ;

$h -> showDiff(callback => \&cb, rev1 => '1.41') ;

$h -> showDiff(callback => \&cb, rev1 => '1.41', rev2 => '1.43') ;

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

DESCRIPTION

This class is used to manage a HMS file. All functions are written in asynchronous mode. So if the process handler is able to handle processes in an asynchronous way, this class will be able to perform HMS operation in non-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.

Contructor

new('name'=> '...', [hmsHost => '...'], [trace => 1|0], ...)

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

Optional parameters are :

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.

trace

If set to 1, debug information are printed.

processClass

Specifies the class name used to handle the sub-processes. Defaults to VcsTools::Process(3).

Methods

checkOut(revision => 'x.y', lock => 1|0, 'callback' => sub_ref)

Checks out revision x.y and eventually lock it.

Callback will be called with (1,$array_ref) if the check out was done and with (0, error_string) in case of problems. The passed array will contain the STDOUT of the check out command

getContent(revision => 'x.y', 'callback' => sub_ref)

Get the content of revision x.y and pass it to the callback function.

Callback will be called with (1,$array_ref) if the check out was done and with (0, error_string) in case of problems. The passed array will contain the content of the file.

checkLock('callback' => sub_ref)

Check if the file is locked and pass the result to callback.

Callback is called with ($result,$rev,$locker) or with (0, error_string) in case of problems.

changeLock(revision => 'x.y', lock => 1|0,'callback' => sub_ref)

Change the lock of the file.

Callback will be called with (1,$array_ref) if the lock was changed was done and with (0, error_string) in case of problems. The passed array will contain the STDOUT of the command..

archiveHistory(...)

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

state to store

callback

Callback will be called with (1,$array_ref) if the history log was changed was done and with (0, error_string) in case of problems. The passed array will contain the STDOUT of the command..

getLog(callback => sub ref)

Gets the complete history of file.

Callback will be called with (1,$array_ref) if the log was extracted from the HMS base and with (0, error_string) in case of problems. The passed array will contain the full history log of the file.

showDiff('rev1' => 'x.y', [rev2 => 'y.z'], callback => sub ref)

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

Callback will be called with (1,$array_ref) if the diff was done and with (0, error_string) in case of problems. The passed array will contain the diff command output.

checkIn(...)

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

revision
log

log to store in the history of revision

callback

Callback will be called with (1,$array_ref) if the check in was done and with (0, error_string) in case of problems. The passed array will contain the STDOUT of the fci command..

AUTHOR

Dominique Dumont, Dominique_Dumont@grenoble.hp.com

Copyright (c) 1998 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), Async::Group(3), VcsTools::Process(3)