Cvs-0.07/0000755000175000017500000000000010155614545011273 5ustar rsrs00000000000000Cvs-0.07/t/0000755000175000017500000000000010155614545011536 5ustar rsrs00000000000000Cvs-0.07/t/00checkout.t0000644000175000017500000000041507607611142013666 0ustar rsrs00000000000000use strict; use Test; use Cwd; use File::Path; plan test => 3; use Cvs; ok(1); my $cvsroot = cwd().'/cvs'; rmtree("cvs-test"); my $cvs = new Cvs ( 'cvs-test', cvsroot => $cvsroot ); ok($cvs); my $rv = $cvs->checkout('test') or die $cvs->error(); ok($rv); Cvs-0.07/t/20tag.t0000644000175000017500000000055107607611142012637 0ustar rsrs00000000000000use strict; use Test; use Cwd; plan test => 6; use Cvs; ok(1); my $cvs = new Cvs 'cvs-test'; ok($cvs); my $result = $cvs->tag("test_$$"); ok($result->tagged, 1); my $status = $cvs->status('test.txt'); ok($status->tags, 3); $result = $cvs->tag("test_$$", {delete => 1}); ok($result->untagged, 1); $status = $cvs->status('test.txt'); ok($status->tags, 2); Cvs-0.07/t/40diff.t0000644000175000017500000000101107613300471012763 0ustar rsrs00000000000000use strict; use Test; use Cwd; plan test => 6; use Cvs; ok(1); my $cvs = new Cvs 'cvs-test'; ok($cvs); open(FILE, "> $ENV{PWD}/cvs-test/test.txt") or die "Cannot open file `$ENV{PWD}/cvs-test/test.txt': $!"; print FILE "test\n"; close(FILE); my $resultlist = $cvs->diff({multiple => 1}); my @modified = $resultlist->get_modified(); ok(@modified, 1); ok($modified[0]->filename(), 'test.txt'); unlink("$ENV{PWD}/cvs-test/test.txt"); my $result = $cvs->update(); ok($result->modified, 0); ok($result->updated, 1); Cvs-0.07/t/21rtag.t0000644000175000017500000000067107611016304013017 0ustar rsrs00000000000000use strict; use Test; use Cwd; plan test => 6; use Cvs; ok(1); my $cvs = new Cvs cvsroot => cwd().'/cvs' or die $Cvs::ERROR; ok($cvs); my $result = $cvs->rtag("test_$$", 'test'); ok($result->success); my $cvs2 = new Cvs 'cvs-test'; my $status = $cvs2->status('test.txt'); ok($status->tags, 3); $result = $cvs->rtag("test_$$", 'test', {delete => 1}); ok($result->success); $status = $cvs2->status('test.txt'); ok($status->tags, 2); Cvs-0.07/t/90release.t0000644000175000017500000000064410025600366013510 0ustar rsrs00000000000000use Test; use Cwd; use File::Path; plan test => 4; use Cvs; ok(1); my $cvsroot = cwd().'/cvs'; my $cvs = new Cvs('cvs-test', cvsroot => $cvsroot); ok($cvs); $cvs->checkout('test'); open(FILE, "> ./cvs-test/test.txt") or die "Cannot open file `./cvs-test/test.txt': $!"; print FILE "test\n"; close(FILE); my $result = $cvs->release({force => 1, delete_after => 1}); ok(!-d "cvs-test"); ok($result->altered, 1); Cvs-0.07/t/05commit.t0000644000175000017500000000073207772312645013371 0ustar rsrs00000000000000use strict; use Test; use Cwd; use Data::Dumper; plan test => 5; use Cvs; ok(1); my $cvs = new Cvs 'cvs-test'; ok($cvs); open(FILE, "> $ENV{PWD}/cvs-test/test.txt") or die "Cannot open file `$ENV{PWD}/cvs-test/test.txt': $!"; print FILE "$$ Cvs commit test"; close FILE; my $commit = $cvs->commit({ recursive => 0, message => 'test commit', }, 'test.txt'); ok($commit->success()); my $old = $commit->old_revision; ok($old); my $new = $commit->new_revision; ok($new); Cvs-0.07/t/30update.t0000644000175000017500000000074407607611142013353 0ustar rsrs00000000000000use strict; use Test; use Cwd; plan test => 6; use Cvs; ok(1); my $cvs = new Cvs 'cvs-test'; ok($cvs); open(FILE, "> $ENV{PWD}/cvs-test/test.txt") or die "Cannot open file `$ENV{PWD}/cvs-test/test.txt': $!"; print FILE "test\n"; close(FILE); my $result = $cvs->update(); my(@modified) = $result->modified(); ok(@modified, 1); ok($modified[0] eq 'test.txt'); unlink("$ENV{PWD}/cvs-test/test.txt"); $result = $cvs->update(); ok($result->modified, 0); ok($result->updated, 1); Cvs-0.07/t/10status.t0000644000175000017500000000115407613300471013403 0ustar rsrs00000000000000use strict; use Test; use Cwd; plan test => 11; use Cvs; ok(1); my $cvs = new Cvs "cvs-test"; ok($cvs); my $status = $cvs->status('test.txt'); ok($status->success); my @tags = $status->tags(); ok(@tags, 2); ok($tags[0], 'rs'); ok($status->tag_revision($tags[0]), '1.1.1'); ok(!$status->is_modified); ok($status->is_up2date); open(FILE, "> $ENV{PWD}/cvs-test/test.txt") or die "Cannot open file `$ENV{PWD}/cvs-test/test.txt': $!"; print FILE "test\n"; close(FILE); $status = $cvs->status('test.txt', {multiple=>1})->first; # testing StatusList ok($status); ok($status->is_modified); ok($status->is_up2date); Cvs-0.07/t/50export.t0000644000175000017500000000045010025601075013376 0ustar rsrs00000000000000use strict; use Test; use Cwd; use File::Path; plan test => 3; use Cvs; ok(1); my $cvsroot = cwd().'/cvs'; my $cvs = new Cvs ( 'cvs-test.export', cvsroot => $cvsroot ); ok($cvs); my $rv = $cvs->export('test', {date=>'now'}) or die $cvs->error(); rmtree("cvs-test.export"); ok($rv); Cvs-0.07/cvs/0000755000175000017500000000000010155614545012066 5ustar rsrs00000000000000Cvs-0.07/cvs/CVSROOT/0000755000175000017500000000000010155614545013225 5ustar rsrs00000000000000Cvs-0.07/cvs/CVSROOT/editinfo,v0000644000175000017500000000230707604056041015211 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "editinfo" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ Cvs-0.07/cvs/CVSROOT/modules,v0000644000175000017500000000250507604056041015060 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. @ Cvs-0.07/cvs/CVSROOT/notify0000644000175000017500000000106407604056041014455 0ustar rsrs00000000000000# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # For example: #ALL mail %s -s "CVS notification" Cvs-0.07/cvs/CVSROOT/checkoutlist,v0000644000175000017500000000126307604056041016111 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [] # # comment lines begin with '#' @ Cvs-0.07/cvs/CVSROOT/history0000644000175000017500000003603410155614540014652 0ustar rsrs00000000000000O3df4ac15|rs|~/devel/Cvs/*0|test||test O3df4ac37|rs|~/devel/Cvs/*0|test||test O3df4ac66|rs|~/devel/Cvs/*0|test||test O3df4b193|rs|~/devel/Cvs/*0|test||test O3df4b1d2|rs|~/devel/Cvs/*0|test||test O3df4b1fb|rs|~/devel/Cvs//tmp/cvs-28339|test||/tmp/cvs-28339 O3df4b20e|rs|~/devel/Cvs//tmp/cvs-28357|test||/tmp/cvs-28357 O3df4b232|rs|~/devel/Cvs//tmp/cvs-28377|test||/tmp/cvs-28377 O3df4cb76|rs|~/devel/Cvs//tmp/cvs-29218|test||/tmp/cvs-29218 O3df4cda2|rs|~/devel/Cvs//tmp/cvs-29267|test||/tmp/cvs-29267 O3df4cf92|rs|~/devel/Cvs//tmp/cvs-29330|test||/tmp/cvs-29330 O3df4d0a7|rs|~/devel/Cvs//tmp/cvs-29368|test||/tmp/cvs-29368 O3e1050d0|rs|~/devel/Cvs//tmp/cvs-775|test||/tmp/cvs-775 O3e105256|rs|~/devel/Cvs//tmp/cvs-1644|test||/tmp/cvs-1644 O3e105a30|rs|~/devel/Cvs//tmp/cvs-4309|test||/tmp/cvs-4309 O3e108746|rs|~/devel/Cvs//tmp/cvs-21240|test||/tmp/cvs-21240 O3e116b9c|rs|~/devel/Cvs/cvs-test-4832|test||cvs-test-4832 O3e116d03|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e116df7|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e116f4c|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e116fb3|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e116fe5|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11700f|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e117037|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e117049|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1170b6|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1171b8|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1171d3|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1172d2|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11748f|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1174c2|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e117501|rs|~/devel/Cvs/*0|test||test O3e1175fd|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e117628|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e117638|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e117657|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e118b8f|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1194c6|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11966a|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11967f|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e119693|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1197e1|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11995a|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e119969|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11997c|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1199bb|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1199da|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e1199f7|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e119a2b|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e119a45|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e119a66|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e119b42|rs|~/devel/Cvs/toto/*0|test||test M3e119b55|rs|~/devel/Cvs/toto/*0|test|1.2|test.txt U3e119ba2|rs|~/devel/Cvs/*0|test|1.2|test.txt O3e11a03e|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a06c|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a137|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a18f|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a1a6|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a1eb|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a1ff|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a253|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a29e|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a2c2|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a2e0|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a2fc|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a325|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11a338|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e11ab68|rs|~/devel/Cvs/cvs-*0|test||cvs-test W3e15e491|rs|~/devel/Cvs/cvs-*0|test||bla W3e15e491|rs|~/devel/Cvs/*0|test||bla M3e15e549|rs|~/devel/Cvs|test|1.3|test.txt O3e197d89|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e197d8c|rs|~/devel/Cvs/cvs-test/.|||. F3e197f9b|rs|~/devel/Cvs/toto/test/.|||. O3e19841d|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e19841f|rs|~/devel/Cvs/cvs-test/.|||. O3e198441|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198443|rs|~/devel/Cvs/cvs-test/.|||. O3e19845a|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e19845c|rs|~/devel/Cvs/cvs-test/.|||. O3e198473|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198475|rs|~/devel/Cvs/cvs-test/.|||. O3e19848e|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198490|rs|~/devel/Cvs/cvs-test/.|||. O3e19849e|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e1984a0|rs|~/devel/Cvs/cvs-test/.|||. O3e1984ba|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e1984bc|rs|~/devel/Cvs/cvs-test/.|||. O3e19853d|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e19853f|rs|~/devel/Cvs/cvs-test/.|||. O3e19854d|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e19854f|rs|~/devel/Cvs/cvs-test/.|||. O3e198584|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198586|rs|~/devel/Cvs/cvs-test/.|||. F3e1985a2|rs|~/devel/Cvs/cvs-test/.|||. F3e1985cb|rs|~/devel/Cvs/cvs-test/.|||. O3e198606|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198608|rs|~/devel/Cvs/cvs-test/.|||. O3e198616|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198618|rs|~/devel/Cvs/cvs-test/.|||. O3e198633|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198635|rs|~/devel/Cvs/cvs-test/.|||. O3e198681|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198683|rs|~/devel/Cvs/cvs-test/.|||. O3e198694|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198696|rs|~/devel/Cvs/cvs-test/.|||. O3e1986d4|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e1986d6|rs|~/devel/Cvs/cvs-test/.|||. F3e198728|rs|~/devel/Cvs/cvs-test/.|||. O3e198816|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198818|rs|~/devel/Cvs/cvs-test/.|||. O3e198825|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198827|rs|~/devel/Cvs/cvs-test/.|||. O3e198858|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e19885a|rs|~/devel/Cvs/cvs-test/.|||. O3e198884|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e198886|rs|~/devel/Cvs/cvs-test/.|||. O3e1988a6|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e1988a8|rs|~/devel/Cvs/cvs-test/.|||. O3e1988b9|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e1988bb|rs|~/devel/Cvs/cvs-test/.|||. O3e1988d5|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e1988d7|rs|~/devel/Cvs/cvs-test/.|||. O3e1988ef|rs|~/devel/Cvs/cvs-*0|test||cvs-test F3e1988f1|rs|~/devel/Cvs/cvs-test/.|||. O3e198963|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e198965|rs|~/devel/Cvs/cvs-test/.|||. O3e19898d|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19898f|rs|~/devel/Cvs/cvs-test/.|||. O3e198a25|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e198a27|rs|~/devel/Cvs/cvs-test/.|||. O3e198a35|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e198a37|rs|~/devel/Cvs/cvs-test/.|||. O3e19959c|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19959e|rs|~/devel/Cvs/cvs-test/.|||. O3e1995d1|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e1995d3|rs|~/devel/Cvs/cvs-test/.|||. O3e19963b|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19963d|rs|~/devel/Cvs/cvs-test/.|||. O3e199647|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e199649|rs|~/devel/Cvs/cvs-test/.|||. O3e199656|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e199658|rs|~/devel/Cvs/cvs-test/.|||. O3e19966d|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19966f|rs|~/devel/Cvs/cvs-test/.|||. O3e1996d7|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e1996d9|rs|~/devel/Cvs/cvs-test/.|||. O3e1996fa|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e1996fc|rs|~/devel/Cvs/cvs-test/.|||. O3e1996ff|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e199701|rs|~/devel/Cvs/cvs-test/.|||. O3e19ac56|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test O3e19ac75|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test O3e19ad74|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test O3e19ad81|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test O3e19adcd|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19adcf|rs|~/devel/Cvs/cvs-test/.|||. O3e19c1f8|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19c1fa|rs|~/devel/Cvs/cvs-test/.|||. O3e19c2d0|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19c2d2|rs|~/devel/Cvs/cvs-test/.|||. O3e19c2e4|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19c2e6|rs|~/devel/Cvs/cvs-test/.|||. O3e19c310|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19c312|rs|~/devel/Cvs/cvs-test/.|||. O3e19c323|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test F3e19c325|rs|~/devel/Cvs/cvs-test/.|||. U3e19c542|rs|~/devel/Cvs/bla|test|1.3|test.txt O3e1c3723|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test U3e1c3726|rs|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e1c3726|rs|~/devel/Cvs/cvs-test/.|||. O3e1c3c06|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test U3e1c3c09|rs|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e1c3c0a|rs|~/devel/Cvs/cvs-test/.|||. O3e1c4228|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test U3e1c422b|rs|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e1c422c|rs|~/devel/Cvs/cvs-test/.|||. O3e1c524b|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test U3e1c524e|rs|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e1c524f|rs|~/devel/Cvs/cvs-test/.|||. O3e1c6aa1|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test U3e1c6aa4|rs|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e1c6aa5|rs|~/devel/Cvs/cvs-test/.|||. O3e1dafb8|rs|~/devel/Cvs//home/rs/devel/Cvs/cvs-*0|test||/home/rs/devel/Cvs/cvs-test U3e1dafbb|rs|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e1dafbc|rs|~/devel/Cvs/cvs-test/.|||. O3e256a58|rs|~/devel/Cvs/cvs-*0|test||cvs-test O3e256a61|root|~/devel/Cvs/cvs-*0|test||cvs-test T3e256a68|root|~/devel/Cvs|A|test_19744|test T3e256a68|root|~/devel/Cvs|D|test_19744|test U3e256a6a|root|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e256a6c|root|~/devel/Cvs/cvs-test|||cvs-test O3e256abf|root|~/devel/Cvs/cvs-*0|test||cvs-test T3e256ac6|root|~/devel/Cvs|A|test_30606|test T3e256ac6|root|~/devel/Cvs|D|test_30606|test U3e256ac8|root|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e256aca|root|~/devel/Cvs/cvs-test|||cvs-test O3e257063|root|~/devel/Cvs/cvs-*0|test||cvs-test T3e25706a|root|~/devel/Cvs|A|test_3646|test T3e25706a|root|~/devel/Cvs|D|test_3646|test U3e25706d|root|~/devel/Cvs/cvs-*0|test|1.3|test.txt F3e25706f|root|~/devel/Cvs/cvs-test|||cvs-test O3fe99583|rs|~/devel/Cvs/cvs-*0|test||cvs-test M3fe99584|rs|~/devel/Cvs/cvs-*0|test|1.4|test.txt T3fe99586|rs|~/devel/Cvs|A|test_27874|test T3fe99586|rs|~/devel/Cvs|D|test_27874|test U3fe99586|rs|~/devel/Cvs/cvs-*0|test|1.4|test.txt U3fe99587|rs|~/devel/Cvs/cvs-*0|test|1.4|test.txt F3fe99588|rs|~/devel/Cvs/cvs-test|||cvs-test O3fe9958a|rs|~/devel/Cvs/cvs-*0|test||cvs-test M3fe9958b|rs|~/devel/Cvs/cvs-*0|test|1.5|test.txt T3fe9958d|rs|~/devel/Cvs|A|test_27939|test T3fe9958d|rs|~/devel/Cvs|D|test_27939|test U3fe9958d|rs|~/devel/Cvs/cvs-*0|test|1.5|test.txt U3fe9958e|rs|~/devel/Cvs/cvs-*0|test|1.5|test.txt F3fe9958f|rs|~/devel/Cvs/cvs-test|||cvs-test O4056fe5a|rs|~/devel/Cvs/cvs-*0|test||cvs-test M4056fe5b|rs|~/devel/Cvs/cvs-*0|test|1.6|test.txt T4056fe5d|rs|~/devel/Cvs|A|test_5234|test T4056fe5d|rs|~/devel/Cvs|D|test_5234|test U4056fe5e|rs|~/devel/Cvs/cvs-*0|test|1.6|test.txt U4056fe5f|rs|~/devel/Cvs/cvs-*0|test|1.6|test.txt E4056fe60|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.17.20|cvs-test.import F4056fe61|rs|~/devel/Cvs/cvs-test|||cvs-test O4056ff62|rs|~/devel/Cvs/cvs-*0|test||cvs-test M4056ff63|rs|~/devel/Cvs/cvs-*0|test|1.7|test.txt T4056ff65|rs|~/devel/Cvs|A|test_11333|test T4056ff65|rs|~/devel/Cvs|D|test_11333|test U4056ff66|rs|~/devel/Cvs/cvs-*0|test|1.7|test.txt U4056ff67|rs|~/devel/Cvs/cvs-*0|test|1.7|test.txt E4056ff68|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.21.44|cvs-test.import F4056ff69|rs|~/devel/Cvs/cvs-test|||cvs-test O4056ff87|rs|~/devel/Cvs/cvs-*0|test||cvs-test M4056ff88|rs|~/devel/Cvs/cvs-*0|test|1.8|test.txt T4056ff8a|rs|~/devel/Cvs|A|test_12072|test T4056ff8a|rs|~/devel/Cvs|D|test_12072|test U4056ff8a|rs|~/devel/Cvs/cvs-*0|test|1.8|test.txt U4056ff8b|rs|~/devel/Cvs/cvs-*0|test|1.8|test.txt E4056ff8c|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.22.20|cvs-test.import F4056ff8d|rs|~/devel/Cvs/cvs-test|||cvs-test O4056ffe5|rs|~/devel/Cvs/cvs-*0|test||cvs-test M4056ffe6|rs|~/devel/Cvs/cvs-*0|test|1.9|test.txt T4056ffe8|rs|~/devel/Cvs|A|test_13326|test T4056ffe8|rs|~/devel/Cvs|D|test_13326|test U4056ffe8|rs|~/devel/Cvs/cvs-*0|test|1.9|test.txt U4056ffe9|rs|~/devel/Cvs/cvs-*0|test|1.9|test.txt E4056ffea|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.23.54|cvs-test.import O40570006|rs|~/devel/Cvs/cvs-*0|test||cvs-test M40570007|rs|~/devel/Cvs/cvs-*0|test|1.10|test.txt T40570009|rs|~/devel/Cvs|A|test_13861|test T40570009|rs|~/devel/Cvs|D|test_13861|test U40570009|rs|~/devel/Cvs/cvs-*0|test|1.10|test.txt U4057000a|rs|~/devel/Cvs/cvs-*0|test|1.10|test.txt E4057000b|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.24.27|cvs-test.import F4057000c|rs|~/devel/Cvs/cvs-test|||cvs-test O4057002d|rs|~/devel/Cvs/cvs-*0|test||cvs-test M4057002e|rs|~/devel/Cvs/cvs-*0|test|1.11|test.txt T40570030|rs|~/devel/Cvs|A|test_14903|test T40570030|rs|~/devel/Cvs|D|test_14903|test U40570030|rs|~/devel/Cvs/cvs-*0|test|1.11|test.txt U40570031|rs|~/devel/Cvs/cvs-*0|test|1.11|test.txt E40570032|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.25.06|cvs-test.import F40570033|rs|~/devel/Cvs/cvs-test|||cvs-test O405700fb|rs|~/devel/Cvs/cvs-*0|test||cvs-test F405700fc|rs|~/devel/Cvs/cvs-test|||cvs-test O40570124|rs|~/devel/Cvs/cvs-*0|test||cvs-test M40570125|rs|~/devel/Cvs/cvs-*0|test|1.12|test.txt T40570127|rs|~/devel/Cvs|A|test_18716|test T40570127|rs|~/devel/Cvs|D|test_18716|test U40570127|rs|~/devel/Cvs/cvs-*0|test|1.12|test.txt U40570128|rs|~/devel/Cvs/cvs-*0|test|1.12|test.txt E40570129|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.29.13|cvs-test.import O4057012a|rs|~/devel/Cvs/cvs-*0|test||cvs-test F4057012a|rs|~/devel/Cvs/cvs-test|||cvs-test O4057015a|rs|~/devel/Cvs/cvs-*0|test||cvs-test M4057015b|rs|~/devel/Cvs/cvs-*0|test|1.13|test.txt T4057015c|rs|~/devel/Cvs|A|test_19517|test T4057015d|rs|~/devel/Cvs|D|test_19517|test U4057015d|rs|~/devel/Cvs/cvs-*0|test|1.13|test.txt U4057015e|rs|~/devel/Cvs/cvs-*0|test|1.13|test.txt E4057015f|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.30.07|cvs-test.import O40570160|rs|~/devel/Cvs/cvs-*0|test||cvs-test F40570160|rs|~/devel/Cvs/cvs-test|||cvs-test O40570164|rs|~/devel/Cvs/cvs-*0|test||cvs-test M40570165|rs|~/devel/Cvs/cvs-*0|test|1.14|test.txt T40570167|rs|~/devel/Cvs|A|test_19698|test T40570167|rs|~/devel/Cvs|D|test_19698|test U40570168|rs|~/devel/Cvs/cvs-*0|test|1.14|test.txt U40570169|rs|~/devel/Cvs/cvs-*0|test|1.14|test.txt E4057016a|rs|~/devel/Cvs/cvs-test.import|test|2004.03.16.13.30.18|cvs-test.import O4057016b|rs|~/devel/Cvs/cvs-*0|test||cvs-test F4057016b|rs|~/devel/Cvs/cvs-test|||cvs-test O41b7195a|rs|~/devel/Cvs/cvs-*0|test||cvs-test M41b7195b|rs|~/devel/Cvs/cvs-*0|test|1.15|test.txt T41b7195d|rs|~/devel/Cvs|A|test_1423|test T41b7195d|rs|~/devel/Cvs|D|test_1423|test U41b7195d|rs|~/devel/Cvs/cvs-*0|test|1.15|test.txt U41b7195e|rs|~/devel/Cvs/cvs-*0|test|1.15|test.txt E41b7195f|rs|~/devel/Cvs/cvs-test.export|test|2004.12.08.15.10.23|cvs-test.export O41b71960|rs|~/devel/Cvs/cvs-*0|test||cvs-test F41b71960|rs|~/devel/Cvs/cvs-test|||cvs-test Cvs-0.07/cvs/CVSROOT/modules0000644000175000017500000000217707604056041014623 0ustar rsrs00000000000000# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. Cvs-0.07/cvs/CVSROOT/verifymsg0000644000175000017500000000200207604056041015151 0ustar rsrs00000000000000# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. Cvs-0.07/cvs/CVSROOT/taginfo,v0000644000175000017500000000206507604056041015040 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- repository # $4-> file revision [file revision ...] # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ Cvs-0.07/cvs/CVSROOT/loginfo0000644000175000017500000000216507604056041014605 0ustar rsrs00000000000000# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # You may specify a format string as part of the # filter. The string is composed of a `%' followed # by a single format character, or followed by a set of format # characters surrounded by `{' and `}' as separators. The format # characters are: # # s = file name # V = old version number (pre-checkin) # v = new version number (post-checkin) # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog Cvs-0.07/cvs/CVSROOT/cvswrappers0000644000175000017500000000136107604056041015524 0ustar rsrs00000000000000# This file affects handling of files based on their names. # # The -t/-f options allow one to treat directories of files # as a single file, or to transform a file in other ways on # its way in and out of CVS. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' Cvs-0.07/cvs/CVSROOT/rcsinfo,v0000644000175000017500000000151707604056041015055 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ Cvs-0.07/cvs/CVSROOT/loginfo,v0000644000175000017500000000247307604056041015051 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # You may specify a format string as part of the # filter. The string is composed of a `%' followed # by a single format character, or followed by a set of format # characters surrounded by `{' and `}' as separators. The format # characters are: # # s = file name # V = old version number (pre-checkin) # v = new version number (post-checkin) # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog @ Cvs-0.07/cvs/CVSROOT/config,v0000644000175000017500000000132507604056041014654 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOFEWGCMAR @ Cvs-0.07/cvs/CVSROOT/notify,v0000644000175000017500000000137207604056041014721 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # For example: #ALL mail %s -s "CVS notification" @ Cvs-0.07/cvs/CVSROOT/commitinfo0000644000175000017500000000137007604056041015311 0ustar rsrs00000000000000# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". Cvs-0.07/cvs/CVSROOT/rcsinfo0000644000175000017500000000121107604056041014602 0ustar rsrs00000000000000# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". Cvs-0.07/cvs/CVSROOT/checkoutlist0000644000175000017500000000075507604056041015654 0ustar rsrs00000000000000# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [] # # comment lines begin with '#' Cvs-0.07/cvs/CVSROOT/verifymsg,v0000644000175000017500000000231007604056041015415 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ Cvs-0.07/cvs/CVSROOT/editinfo0000644000175000017500000000200107604056041014736 0ustar rsrs00000000000000# The "editinfo" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. Cvs-0.07/cvs/CVSROOT/taginfo0000644000175000017500000000155707604056041014603 0ustar rsrs00000000000000# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- repository # $4-> file revision [file revision ...] # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". Cvs-0.07/cvs/CVSROOT/cvswrappers,v0000644000175000017500000000166707604056041015777 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# This file affects handling of files based on their names. # # The -t/-f options allow one to treat directories of files # as a single file, or to transform a file in other ways on # its way in and out of CVS. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' @ Cvs-0.07/cvs/CVSROOT/val-tags0000644000175000017500000000000007604056041014650 0ustar rsrs00000000000000Cvs-0.07/cvs/CVSROOT/commitinfo,v0000644000175000017500000000167607604056041015564 0ustar rsrs00000000000000head 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2002.12.09.14.40.51; author rs; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ Cvs-0.07/cvs/CVSROOT/config0000644000175000017500000000101707604056041014410 0ustar rsrs00000000000000# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOFEWGCMAR Cvs-0.07/cvs/test/0000755000175000017500000000000010155614545013045 5ustar rsrs00000000000000Cvs-0.07/cvs/test/test.txt,v0000644000175000017500000000425510155614535015034 0ustar rsrs00000000000000head 1.15; access; symbols start:1.1.1.1 rs:1.1.1; locks; strict; comment @# @; 1.15 date 2004.12.08.15.10.19; author rs; state Exp; branches; next 1.14; 1.14 date 2004.03.16.13.30.13; author rs; state Exp; branches; next 1.13; 1.13 date 2004.03.16.13.30.03; author rs; state Exp; branches; next 1.12; 1.12 date 2004.03.16.13.29.09; author rs; state Exp; branches; next 1.11; 1.11 date 2004.03.16.13.25.02; author rs; state Exp; branches; next 1.10; 1.10 date 2004.03.16.13.24.23; author rs; state Exp; branches; next 1.9; 1.9 date 2004.03.16.13.23.50; author rs; state Exp; branches; next 1.8; 1.8 date 2004.03.16.13.22.16; author rs; state Exp; branches; next 1.7; 1.7 date 2004.03.16.13.21.39; author rs; state Exp; branches; next 1.6; 1.6 date 2004.03.16.13.17.15; author rs; state Exp; branches; next 1.5; 1.5 date 2003.12.24.13.32.59; author rs; state Exp; branches; next 1.4; 1.4 date 2003.12.24.13.32.52; author rs; state Exp; branches; next 1.3; 1.3 date 2003.01.03.19.32.24; author rs; state Exp; branches; next 1.1; 1.1 date 2002.12.09.14.42.03; author rs; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2002.12.09.14.42.03; author rs; state Exp; branches; next ; desc @@ 1.15 log @test commit @ text @1403 Cvs commit test@ 1.14 log @test commit @ text @d1 1 a1 1 19667 Cvs commit test@ 1.13 log @test commit @ text @d1 1 a1 1 19486 Cvs commit test@ 1.12 log @test commit @ text @d1 1 a1 1 18681 Cvs commit test@ 1.11 log @test commit @ text @d1 1 a1 1 14853 Cvs commit test@ 1.10 log @test commit @ text @d1 1 a1 1 13812 Cvs commit test@ 1.9 log @test commit @ text @d1 1 a1 1 13296 Cvs commit test@ 1.8 log @test commit @ text @d1 1 a1 1 12029 Cvs commit test@ 1.7 log @test commit @ text @d1 1 a1 1 11285 Cvs commit test@ 1.6 log @test commit @ text @d1 1 a1 1 5186 Cvs commit test@ 1.5 log @test commit @ text @d1 1 a1 1 27919 Cvs commit test@ 1.4 log @test commit @ text @d1 1 a1 1 27854 Cvs commit test@ 1.3 log @* Add the command release * Rewrite of the run mechanism * Build a command result parser * Fix many bugs * Add some test scripts @ text @d1 1 a1 1 h ello world @ 1.1 log @Initial revision @ text @d1 1 a1 1 hello @ 1.1.1.1 log @ @ text @@ Cvs-0.07/lib/0000755000175000017500000000000010155614545012041 5ustar rsrs00000000000000Cvs-0.07/lib/Cvs/0000755000175000017500000000000010155614545012574 5ustar rsrs00000000000000Cvs-0.07/lib/Cvs/Result/0000755000175000017500000000000010155614545014052 5ustar rsrs00000000000000Cvs-0.07/lib/Cvs/Result/RdiffItem.pm0000644000175000017500000000273507613315666016277 0ustar rsrs00000000000000package Cvs::Result::RdiffItem; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::RdiffItem - Result class for cvs rdiff command =head1 DESCRIPTION This class handle the cvs rdiff result for one file. =head1 FIELDS =head2 filename Returns the item's filename. =cut Cvs::Result::RdiffItem->mk_accessors (qw( filename from_revision to_revision is_added is_removed )); sub is_modified { my($self) = @_; # is modified if neither added nor removed if(not $self->is_added and not $self->is_removed) { return 1; } } sub push_diff { my($self, $line) = @_; push(@{$self->{_diff}}, $line); } sub get_diff {return @{shift->{_diff}||[]}}; 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/StatusItem.pm0000644000175000017500000000645207613300362016513 0ustar rsrs00000000000000package Cvs::Result::StatusItem; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::StatusItem - Result class for cvs status command =head1 DESCRIPTION This class handle the cvs status result for one file. =head1 FIELDS =head2 exists Returns a boolean value regarding on the file existence. =head2 filename Returns the item's filename. =head2 basedir Returns the item's basedir. =head2 status Returns the item's status. =head2 working_revision Returns the revision of the item you are working on. =head2 repository_revision Returns the revision of the item in the remote repository? =head2 sticky_tag Returns the sticky tag if any, undef otherwise. =head2 sticky_date Returns the sticky date if any, undef otherwise. =head2 sticky_options Returns the sticky options if any, undef otherwise. =cut Cvs::Result::StatusItem->mk_accessors (qw( exists filename basedir status working_revision repository_revision sticky_tag sticky_date sticky_options )); sub push_tag { my($self, $tag, $type) = @_; push @{$self->{tags}}, [$tag, $type]; } =pod =head2 tags Returns the list of tags on item. =cut sub tags { my($self) = @_; return map $_->[0], reverse @{$self->{tags}||[]}; } =pod =head2 tag_type $status->tag_type($tag); Returns the type of supplied tag. (revision or branch) =cut sub tag_type { my($self, $tag) = @_; foreach(@{$self->{tags}}) { if($_->[0] eq $tag) { $_->[1] =~ /^\((\w+)/; return $1; } } } =pod =head2 tag_revision $status->tag_type($tag); Returns the revision of item binded with supplied tag. =cut sub tag_revision { my($self, $tag) = @_; foreach(@{$self->{tags}}) { if($_->[0] eq $tag) { $_->[1] =~ /^\(\w+: (.*?)\)/; return $1; } } } =pod =head1 METHODS =head2 is_modified Returns true if item is locally modified. =cut sub is_modified { my($self) = @_; return defined $self->status && $self->status =~ /Locally Modified|Needs Merge/; } =pod =head2 is_up2date Returns true if item is up to date. =cut sub is_up2date { my($self) = @_; return defined $self->status && $self->status =~ /Up-to-date|Locally Modified/; } =pod =head2 is_merge_needed Returns true if item is locally and remotelly modified.This mean that a merge will be tried on the next update. =cut sub is_merge_needed { my($self) = @_; return defined $self->status && $self->status eq 'Needs Merge'; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/RdiffList.pm0000644000175000017500000000554307620741553016310 0ustar rsrs00000000000000package Cvs::Result::RdiffList; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::RdiffList - Result list for cvs rdiff command =head1 DESCRIPTION Iterator class for Cvs::Result::RdiffItem classes. =cut sub init { my $self = shift->SUPER::init(@_); $self->{items} = []; $self->{index} = -1; $self->{last} = -1; return $self; } sub push { my($self, $item) = @_; push(@{$self->{items}}, $item); return ++$self->{last}; } =pod =head1 METHODS =head2 as_next =cut sub as_next { my($self) = @_; return $self->{index} < $self->{last}; } =pod =head1 next =cut sub next { my($self) = @_; return $self->{items}->[++$self->{index}]; } =pod =head1 as_prev =cut sub as_prev { my($self) = @_; return $self->index > 0; } =pod =head1 prev =cut sub prev { my($self) = @_; return unless $self->as_prev; $self->{items}->[--$self->{index}]; } =pod =head1 current =cut sub current { my($self) = @_; $self->{items}->[$self->{index}]; } =pod =head1 last =cut sub last { my($self) = @_; $self->{items}->[$self->{last}]; } =pod =head1 count Return number of items. =cut sub count { my($self) = @_; return scalar @{$self->{items}}; } =pod =head1 first =cut sub first { my($self) = @_; $self->{items}->[0]; } =pod =head1 index =cut sub index {shift->{index}} =pod =head1 rewind =cut sub rewind {shift->{index} = -1} =pod =head1 get_added Returns the list of items which were added =cut sub get_added { my($self) = @_; return grep($_->is_added(), @{$self->{items}}) } =pod =head1 get_removed Returns the list of items which were removed =cut sub get_removed { my($self) = @_; return grep($_->is_removed(), @{$self->{items}}) } =pod =head1 get_modified Returns the list of items which were modified =cut sub get_modified { my($self) = @_; return grep($_->is_modified(), @{$self->{items}}) } =pod =head1 get_diff Returns diffs of all files concatenated =cut sub get_diff { my($self) = @_; return map($_->get_diff(), @{$self->{items}}); } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Export.pm0000644000175000017500000000163510025575650015675 0ustar rsrs00000000000000package Cvs::Result::Export; use strict; use base qw(Cvs::Result::Base); sub init { my $self = shift->SUPER::init(@_); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Rtag.pm0000644000175000017500000000353407613300362015304 0ustar rsrs00000000000000package Cvs::Result::Rtag; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::Rtag - Result class for the cvs tag command. =head1 DESCRIPTION This class handle things that compose the result of the cvs rtag command. =head1 METHODS =head3 get_warning my $warn_str = $result->get_warning($file); Get the warning message for the specified file if any. =head1 FIELDS =head2 tagged Returns the list of tagged files if any. =head2 untagged Returns the list of untagged files if any. =head2 warned Return the lost of file who's got warning =cut sub push_tagged { my($self, $file) = @_; push @{$self->{tagged}}, $file; } sub tagged { return @{shift->{tagged}||[]}; } sub push_untagged { my($self, $file) = @_; push @{$self->{untagged}}, $file; } sub untagged { return @{shift->{untagged}||[]}; } sub push_warning { my($self, $file, $warning) = @_; $self->{warning}->{$file} = $warning; } sub warned { return keys %{shift->{warning}||{}}; } sub get_warning { my($self, $file) = @_; return $self->{warning}->{$file}; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Base.pm0000644000175000017500000000213507613300362015255 0ustar rsrs00000000000000package Cvs::Result::Base; use strict; use base qw(Class::Accessor); Cvs::Result::Base->mk_accessors(qw(success error)); sub new { my($proto, @args) = @_; my $class = ref $proto || $proto; my $self = {}; bless($self, $class); return $self->init(@args); } sub init { my($self, @args) = @_; return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Update.pm0000644000175000017500000000365107614272356015645 0ustar rsrs00000000000000package Cvs::Result::Update; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::Update - Result class for cvs update command =head1 DESCRIPTION =head1 FIELDS =head2 updated =head2 patched =head2 added =head2 removed =head2 modified =head2 conflict =head2 merged =head2 unknown =head2 gone =cut my %types = ( U => 'updated', P => 'patched', A => 'added', R => 'removed', M => 'modified', C => 'conflict', '?' => 'unknown', G => 'gone', ); Cvs::Result::Update->mk_accessors(values %types); # override get method of Class::Accessor class sub get { my($self, $key) = @_; if(ref $self->{$key} eq 'ARRAY') { return @{$self->{$key}}; } else { return $self->{$key}; } } sub init { my($self) = @_; $self->{$_} = [] for values %types; return $self; } sub add_entry { my($self, $type, $file) = @_; push @{$self->{$types{$type}}}, $file; } sub push_ignored_directory { my($self, $directory) = @_; push @{$self->{ignored_directories}}, $directory; } sub ignored_directories { my($self) = @_; return @{$self->{ignored_directories}||[]}; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/DiffItem.pm0000644000175000017500000000274707613315666016120 0ustar rsrs00000000000000package Cvs::Result::DiffItem; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::DiffItem - Result class for cvs status command =head1 DESCRIPTION This class handle the cvs diff result for one file. =head1 FIELDS =head2 filename Returns the item's filename. =cut Cvs::Result::DiffItem->mk_accessors (qw( filename rcs_file from_revision to_revision is_added is_removed )); sub is_modified { my($self) = @_; # is modified if neither added nor removed if(not $self->is_added and not $self->is_removed) { return 1; } } sub push_diff { my($self, $line) = @_; push(@{$self->{_diff}}, $line); } sub get_diff {return @{shift->{_diff}||[]}}; 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Logout.pm0000644000175000017500000000152607613300362015657 0ustar rsrs00000000000000package Cvs::Result::Logout; use strict; use base qw(Cvs::Result::Base); 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/StatusList.pm0000644000175000017500000000425707620741553016542 0ustar rsrs00000000000000package Cvs::Result::StatusList; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::StatusList - Result list for cvs status command =head1 DESCRIPTION Iterator class for Cvs::Result::StatusItem classes. =cut sub init { my $self = shift->SUPER::init(@_); $self->{items} = []; $self->{index} = -1; $self->{last} = -1; return $self; } sub push { my($self, $item) = @_; push(@{$self->{items}}, $item); return ++$self->{last}; } =pod =head1 METHODS =head2 as_next =cut sub as_next { my($self) = @_; return $self->{index} < $self->{last}; } =pod =head1 next =cut sub next { my($self) = @_; return $self->{items}->[++$self->{index}]; } =pod =head1 as_prev =cut sub as_prev { my($self) = @_; return $self->index > 0; } =pod =head1 prev =cut sub prev { my($self) = @_; return unless $self->as_prev; $self->{items}->[--$self->{index}]; } =pod =head1 current =cut sub current { my($self) = @_; $self->{items}->[$self->{index}]; } =pod =head1 last =cut sub last { my($self) = @_; $self->{items}->[$self->{last}]; } =pod =head1 count =cut sub count { my($self) = @_; return scalar @{$self->{items}}; } =pod =head1 first =cut sub first { my($self) = @_; $self->{items}->[0]; } =pod =head1 index =cut sub index {shift->{index}} =pod =head1 rewind =cut sub rewind {shift->{index} = -1} 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/DiffList.pm0000644000175000017500000000550707620741553016126 0ustar rsrs00000000000000package Cvs::Result::DiffList; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::DiffList - Result list for cvs diff command =head1 DESCRIPTION Iterator class for Cvs::Result::DiffItem classes. =cut sub init { my $self = shift->SUPER::init(@_); $self->{items} = []; $self->{index} = -1; $self->{last} = -1; return $self; } sub push { my($self, $item) = @_; push(@{$self->{items}}, $item); return ++$self->{last}; } =pod =head1 METHODS =head2 as_next =cut sub as_next { my($self) = @_; return $self->{index} < $self->{last}; } =pod =head1 next =cut sub next { my($self) = @_; return $self->{items}->[++$self->{index}]; } =pod =head1 as_prev =cut sub as_prev { my($self) = @_; return $self->index > 0; } =pod =head1 prev =cut sub prev { my($self) = @_; return unless $self->as_prev; $self->{items}->[--$self->{index}]; } =pod =head1 current =cut sub current { my($self) = @_; $self->{items}->[$self->{index}]; } =pod =head1 last =cut sub last { my($self) = @_; $self->{items}->[$self->{last}]; } =pod =head1 count =cut sub count { my($self) = @_; return scalar @{$self->{items}}; } =pod =head1 first =cut sub first { my($self) = @_; $self->{items}->[0]; } =pod =head1 index =cut sub index {shift->{index}} =pod =head1 rewind =cut sub rewind {shift->{index} = -1} =pod =head1 get_added Returns the list of items which were added =cut sub get_added { my($self) = @_; return grep($_->is_added(), @{$self->{items}}) } =pod =head1 get_removed Returns the list of items which were removed =cut sub get_removed { my($self) = @_; return grep($_->is_removed(), @{$self->{items}}) } =pod =head1 get_modified Returns the list of items which were modified =cut sub get_modified { my($self) = @_; return grep($_->is_modified(), @{$self->{items}}) } =pod =head1 get_diff Returns diffs of all files concatenated =cut sub get_diff { my($self) = @_; return map($_->get_diff(), @{$self->{items}}); } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Tag.pm0000644000175000017500000000353107613300362015117 0ustar rsrs00000000000000package Cvs::Result::Tag; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::Tag - Result class for the cvs tag command. =head1 DESCRIPTION This class handle things that compose the result of the cvs tag command. =head1 METHODS =head3 get_warning my $warn_str = $result->get_warning($file); Get the warning message for the specified file if any. =head1 FIELDS =head2 tagged Returns the list of tagged files if any. =head2 untagged Returns the list of untagged files if any. =head2 warned Return the lost of file who's got warning =cut sub push_tagged { my($self, $file) = @_; push @{$self->{tagged}}, $file; } sub tagged { return @{shift->{tagged}||[]}; } sub push_untagged { my($self, $file) = @_; push @{$self->{untagged}}, $file; } sub untagged { return @{shift->{untagged}||[]}; } sub push_warning { my($self, $file, $warning) = @_; $self->{warning}->{$file} = $warning; } sub warned { return keys %{shift->{warning}||{}}; } sub get_warning { my($self, $file) = @_; return $self->{warning}->{$file}; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Checkout.pm0000644000175000017500000000163707613300362016156 0ustar rsrs00000000000000package Cvs::Result::Checkout; use strict; use base qw(Cvs::Result::Base); sub init { my $self = shift->SUPER::init(@_); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Release.pm0000644000175000017500000000234107613300362015762 0ustar rsrs00000000000000package Cvs::Result::Release; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::Release - Result class for the release command. =head1 DESCRIPTION This class handle things that compose the result of the release command. =head1 FIELDS =head2 altered Returns the list of altered files if any. =cut sub push_altered { my($self, $file) = @_; push @{$self->{altered}}, $file; } sub altered { return @{shift->{altered}||[]}; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Commit.pm0000644000175000017500000000337307772313570015653 0ustar rsrs00000000000000package Cvs::Result::Commit; use strict; use base qw(Cvs::Result::Base); =pod =head1 NAME Cvs::Result::Commit - Result class for cvs commit command =head1 SYNOPSIS my $commit = $cvs->commit ( { recursive => 0, message => 'bar', }, 'changed.txt' ); my $old = $commit->old_revision; my $new = $commit->new_revision; =head1 DESCRIPTION Returns the old and new revisions of a previously checked-in file. =head1 METHODS =head2 old_revision Returns the old revision of the file checked in. Will return undef if no change in version occurred. =head2 new_revision Returns the new revision of the file checked in. Will return undef if no change in version occurred. =cut Cvs::Result::Commit->mk_accessors (qw( old_revision new_revision )); sub set_revision { my $self = shift; my ($old, $new) = @_; $self->{old_revision} = $old; $self->{new_revision} = $new; } 1; =pod =head1 SEE ALSO L, L, cvs(1). =head1 AUTHOR Steven Cotton Ecotton@cpan.orgE =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Result/Login.pm0000644000175000017500000000152507613300362015455 0ustar rsrs00000000000000package Cvs::Result::Login; use strict; use base qw(Cvs::Result::Base); 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/0000755000175000017500000000000010155614545014152 5ustar rsrs00000000000000Cvs-0.07/lib/Cvs/Command/Rdiff.pm0000644000175000017500000000667407613315666015566 0ustar rsrs00000000000000package Cvs::Command::Rdiff; use strict; use Cvs::Result::RdiffList; use Cvs::Result::RdiffItem; use base qw(Cvs::Command::Base); sub init { my($self, @modules) = @_; $self->SUPER::init(@_) or return; $self->default_params ( from_date => undef, to_date => undef, from_revision => undef, to_revision => undef, ); my $param = pop @modules if ref $modules[-1] eq 'HASH'; $param = $self->param($param||{}); return $self->error('can\'t have more than one source type') if((defined $param->{from_date} and defined $param->{from_revision})); return $self->error('can\'t have more than one destination type') if((defined $param->{to_date} and defined $param->{to_revision})); return $self->error('you must specify a source') if not defined $self->param->{from_date} and not defined $self->param->{from_revision}; $self->command('rdiff'); $self->push_arg('-u'); $self->push_arg('-r', $self->param->{from_revision}) if defined $self->param->{from_revision}; $self->push_arg('-D', $self->param->{from_date}) if defined $self->param->{from_date}; $self->push_arg('-r', $self->param->{to_revision}) if defined $self->param->{to_revision}; $self->push_arg('-D', $self->param->{to_date}) if defined $self->param->{to_date}; $self->push_arg(@modules); $self->need_workdir(0); my $main = $self->new_context(); $self->initial_context($main); my $result; my $resultlist = new Cvs::Result::RdiffList; $resultlist->success(1); $self->result($resultlist); $main->push_handler ( qr/^Index: (.*)\n$/, sub { $result = new Cvs::Result::RdiffItem; $result->filename(shift->[1]); $result->success(1); $resultlist->push($result); } ); $main->push_handler ( qr/^diff -u (?:\/dev\/null|.*?:([\d\.]+))\s+.*?:([\d\.]+|removed)$/, sub { my($match) = @_; my($r1, $r2) = ($match->[1], $match->[2]); if(defined $r1 and length $r1) { $result->from_revision($r1); } else { $result->is_added(1); } if($r2 eq 'removed') { $result->is_removed(1); } else { $result->to_revision($r2); } $result->push_diff($match->[0]); } ); $main->push_handler ( qr/^cvs rdiff: .*$/, sub { # do nothing } ); $main->push_handler ( qr/^[\-\+@ ]/, sub { $result->push_diff(shift->[0]); } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Status.pm0000644000175000017500000001045410033216260015762 0ustar rsrs00000000000000package Cvs::Command::Status; use strict; use Cvs::Result::StatusList; use Cvs::Result::StatusItem; use base qw(Cvs::Command::Base); sub init { my($self, @file_list) = @_; $self->SUPER::init(@_) or return; $self->default_params ( multiple => 0, recursive => 1, ); my $param = pop @file_list if ref $file_list[-1] eq 'HASH'; $self->param($param); $self->command('status'); $self->push_arg('-l') unless $self->param->{recursive}; $self->push_arg('-v', @file_list); my $main = $self->new_context; my $tags = $self->new_context; $self->initial_context($tags); my($resultlist, $current_directory); my $result = $self->err_result('No file in response'); $tags->push_handler ( qr/cvs (?:status|server): Examining (.*)\n$/, sub { $current_directory = shift->[1]; } ); $tags->push_handler ( qr/^=+$/, sub { if($self->param->{multiple}) { unless(defined $resultlist) { $resultlist = new Cvs::Result::StatusList; $self->result($resultlist); } $result = new Cvs::Result::StatusItem; $resultlist->push($result); } else { if($result->isa('Cvs::Result::StatusItem')) { return $tags->finish(); } else { $result = new Cvs::Result::StatusItem; $self->result($result); } } # switch to main context return $main; } ); $tags->push_handler ( qr/^\s+([^\s]+)\s+(\(.*\))\s*$/, sub { my($match) = @_; $result->push_tag($match->[1], $match->[2]); } ); $tags->push_handler ( qr/No Tags Exist/, sub { # nothing to do... } ); $main->push_handler ( qr/^File: (.*)\s+Status: (.*)\n$/, sub { my($match) = @_; my $filename = $match->[1]; $filename =~ s/^\s+|\s$//g; $result->basedir($current_directory); $result->status($match->[2]); $result->exists(1); if($filename =~ /^no file (.*)$/) { $filename = $1; $result->exists(0); } $result->filename($filename); } ); $main->push_handler ( qr/^\s+Working revision:\s+([\d\.]+|No entry for .*)/, sub { my($match) = @_; $result->working_revision($match->[1]) if $match->[1] =~ /^[\d.]+$/; } ); $main->push_handler ( qr/^\s+Repository revision:\s+([\d\.]+|No revision control file)/, sub { my($match) = @_; $result->repository_revision($match->[1]) if $match->[1] =~ /^[\d.]+$/; } ); $main->push_handler ( qr/^\s+Sticky Tag:\s+(.*)\s*$/, sub { my($match) = @_; $result->sticky_tag($match->[1]) unless $match->[1] eq '(none)'; } ); $main->push_handler ( qr/^\s+Sticky Date:\s+(.*)\s*$/, sub { my($match) = @_; $result->sticky_date($match->[1]) unless $match->[1] eq '(none)'; } ); $main->push_handler ( qr/\s+Sticky Options:\s+(.*)\s*$/, sub { my($match) = @_; $result->sticky_options($match->[1]) unless $match->[1] eq '(none)'; } ); $main->push_handler ( qr/\s+Existing Tags:/, sub { # switching to tags context return $tags } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Tag.pm0000644000175000017500000000537707613315666015246 0ustar rsrs00000000000000package Cvs::Command::Tag; use strict; use Cvs::Result::Tag; use base qw(Cvs::Command::Base); sub init { my($self, $tag, @files) = @_; $self->SUPER::init(@_) or return; my $param = {}; if(defined $files[-1] && ref $files[-1] eq 'HASH') { $param = pop @files; } return $self->error('Missing mandatory option for tag') unless defined $tag; $self->default_params ( delete => 0, force => 0, branch => 0, release => undef, date => undef, recursive => 1, ); $self->param($param); $self->command('tag'); $self->push_arg('-d') if $self->param->{delete}; $self->push_arg('-F') if $self->param->{force}; $self->push_arg('-b') if $self->param->{branch}; $self->push_arg('-r', $self->param->{release}) if $self->param->{release}; $self->push_arg('-D', $self->param->{date}) if $self->param->{date}; $self->push_arg('-l') unless $self->param->{recursive}; $self->push_arg($tag, @files); my $main = $self->new_context(); $self->initial_context($main); my $result = new Cvs::Result::Tag; $self->result($result); my $current_directory = ''; $main->push_handler ( qr/^cvs tag: (?:Unt|T)agging (.*)\n$/, sub { $current_directory = shift->[1]; } ); $main->push_handler ( qr/^T (.*)\n$/, sub { my($match) = @_; my $file = $current_directory eq '.' ? $match->[1] : $current_directory . '/'. $match->[1]; $result->push_tagged($file); } ); $main->push_handler ( qr/^W (.*?) : (.*)\n$/, sub { my($match) = @_; $result->push_warning($match->[1], $match->[2]); } ); $main->push_handler ( qr/^D (.*)\n$/, sub { my $file = $current_directory eq '.' ? shift->[1] : $current_directory . '/'. shift->[1]; $result->push_untagged($file); } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Login.pm0000644000175000017500000000431307772310260015557 0ustar rsrs00000000000000package Cvs::Command::Login; use strict; use Cvs::Result::Login; use Cvs::Cvsroot; use base qw(Cvs::Command::Base); sub init { my($self, $param) = @_; $self->SUPER::init(@_) or return; $self->default_params(cvsroot => undef); $self->param($param); $self->command('login'); my $result = new Cvs::Result::Login; $self->result($result); my $cvsroot; if(defined $self->param->{cvsroot}) { $cvsroot = new Cvs::Cvsroot $self->param->{cvsroot}, %$param; $self->cvsroot($cvsroot); } elsif(defined $self->cvs->cvsroot()) { $cvsroot = $self->cvs->cvsroot(); } else { $result->success(0); $result->error('No cvsroot to login on, please define one.'); $self->command(undef); } my $main = $self->new_context(); $self->initial_context($main); $main->push_handler ( qr/^CVS password/, sub { $self->send($cvsroot->password()."\n"); } ); $main->push_handler ( qr/can only use .login. command with the .pserver. method/, sub { # do not fail if login was used with bad method, we don't care $result->success(1); $main->finish(); } ); $main->push_handler ( qr/cvs login: authorization failed/, sub { $result->success(0); $result->error('authorization failed'); $main->finish(); } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Release.pm0000644000175000017500000000516410034602147016065 0ustar rsrs00000000000000package Cvs::Command::Release; use strict; use Cvs::Result::Release; use base qw(Cvs::Command::Base); sub init { my($self, @modules) = @_; $self->SUPER::init(@_) or return; my $param = {}; if(defined $modules[-1] && ref $modules[-1] eq 'HASH') { $param = pop @modules; } $self->default_params ( delete_after => 0, force => 0, ); $self->param($param); $self->command('release'); $self->push_arg('-d') if $self->param->{delete_after}; $self->push_arg(@modules ? @modules : $self->cvs->workdir()); $self->go_into_workdir(0); my $main = $self->new_context(); $self->initial_context($main); my $result = new Cvs::Result::Release; $self->result($result); $main->push_handler ( qr/^M (.*)$/, sub { $result->push_altered(shift->[1]); } ); $main->push_handler ( qr/^You have \[(\d+)\] altered files in this repository\.$/, sub { my($match) = @_; unless($match->[1] == $result->altered()) { my $found = $result->altered(); warn "Internal error, we haven't found an equal ". "number of altered files than cvs. ". "Found: $found cvs said: $match->[1]"; } } ); $main->push_handler ( qr/^Are you sure you want to release.* directory .*:\s*$/, sub { if(defined $result->altered && $result->altered == 0 or $self->param->{force}) { $self->send("y\n"); } else { $self->send("n\n"); } $result->success(1); } ); $main->push_handler ( qr/cvs release: deletion of directory .* failed: Invalid argument/, sub { $result->success(0); $result->error(shift->[0]); } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Base.pm0000644000175000017500000002720010031753014015347 0ustar rsrs00000000000000package Cvs::Command::Base; use strict; use Cwd; use IPC::Run; use base qw(Class::Accessor); Cvs::Command::Base->mk_accessors (qw( cvsroot command args cvs need_workdir initial_context result go_into_workdir )); sub new { my($proto, $cvs, @args) = @_; my $class = ref $proto || $proto; my $self = {}; bless($self, $class); $self->cvs($cvs) or die "this shouldn't happend"; $self->go_into_workdir(1); $self->need_workdir(1); return ($self->init(@args))[0]; } sub init { return shift; } sub workdir {shift->cvs->workdir()} sub run { my($self) = @_; my $debug = $self->cvs->debug(); # # Preparing environment and parameters # my $old_pwd; if($self->need_workdir()) { # this can append when the Cvs object is created without a # working directory, and a sub-command that need it is called return $self->err_result('no such working directory') unless defined $self->workdir(); # keep current working directory $old_pwd = cwd(); if($self->go_into_workdir()) { print STDERR "** Chdir to: ", $self->cvs->working_directory(), "\n" if $debug; chdir($self->cvs->working_directory()); } else { print STDERR "** Chdir to: ", $self->cvs->pwd(), "\n" if $debug; chdir($self->cvs->pwd()); } } # getting sub-command my $sub_command = $self->command(); unless(defined $sub_command) { if(defined $self->result()) { # this command don't need to be ran return $self->result(); } else { return $self->err_result('empty result, it\'s a bug !') } } # getting cvsroot my $cvsroot = $self->cvsroot() || $self->cvs->cvsroot(); return $self->err_result('no such cvsroot') unless(defined $cvsroot); # getting context, if none we spawn one my $context = $self->initial_context(); unless(defined $context) { $context = $self->new_context(); $self->initial_context($context); } # bind cvsroot handlers to the context $cvsroot->bind($self); # bind common handlers $self->bind(); my @command = ('cvs'); push @command, '-f', '-d', $cvsroot->cvsroot(); push @command, '-t' if $debug > 1; push @command, $sub_command, $self->args(); # # Starting command # print(STDERR join(' ', '>>', @command), "\n") if $debug; my($in, $out) = ('', ''); # pty is needed for login sub-command (and maybe for something # else) because it open pty for prompting the password :( my $h = IPC::Run::harness(\@command, \$in, '>pty>', \$out, '2>&1'); $h->start(); $self->{harness} = $h; # # Parsing command result # # It's not trivial to parse the cvs output, because the output may # stall, and we never be sure that the command as finish, if a # line is complete or if the command is waiting for input (like a # password). my($first, $last, $line, $match, $debugline); while(defined $context && $h->pump && length $out) { $first = 1; $match = 0; # flushing the send buffer $self->{data} = ''; print STDERR "** new chunk\n" if $debug; while(defined $context && $out =~ /.*?(?:\r?\n|$)/g) { # my unperfect regexp match an empty line at end of # certain strings... skip it next unless length $&; $line = $&; $line =~ s/\r/\n/g; $line =~ s/\n+/\n/g; if($debug) { if($line =~ /^(?: |S)-> / or (defined $debugline and $debugline eq 'unterminated')) { print STDERR $line; # if the cvs debug line is truncated, try to not # treat next parts as real cvs response component $debugline = $line =~ /\n/ ? undef : 'unterminated'; undef $line; next; } $debugline = $line; # make CR and LF visible $debugline =~ s/\r/\\r/g; $debugline =~ s/\n/\\n/g; print STDERR "<< $debugline\n"; } # don't analyse empty lines, but $line have to be set next if $line =~ /^\n*$/; # Analysing the line: if a context is return, we replace # the current one with it to handling context # switching. If an undef value is returned, it's means # that no further analyse will be expected. The second # element is a boolean value which be true if the line # matched. ($context, $match) = $context->analyse($line); # this variable isn't relevant for others than first line, # see comments below undef($last) unless $first; if(not $match) { if(defined $last) { # cvs sends its output in chunks and each chunk # doesn't necessary finish at the end of the # line. So we recover the last line of last chunk # if it was unmatched by any rules and we join it # with the first line of the current chunk if it # wasn't match too, to see if it match more. ($context, $match) = $context->analyse("$last$line"); if($debug) { my $un = $match ? '' : 'un'; print STDERR "** ${un}matched recomposed line: $last$debugline\n"; } } else { print STDERR "** unmatched line: $debugline\n" if $debug; } } $first = 0; } # we don't want to parse several times the same thing $out = ''; # keep the last line if it doesn't be used, it's maybe an # unterminated line. If line end with line-feed, this can't be # an unterminated line. if($match or not defined $line or $line =~ /\n$/) { undef($last); } elsif(length $line) { $last .= $line; print STDERR "** new \$last value: $last\n" if $debug; } # check out if some input want be send if(length $self->{data}) { $in = $self->{data}; print STDERR ">> $in\n" if $debug; # wait for all input to go $h->pump_nb while length $in; } } my $rv = $h->finish() || $?; # # Restoring/cleaning-up environment # # exec cleanup codes if any if(defined $self->{cleanup}) { print STDERR "** Do some cleanup tasks\n" if $debug; &$_ for @{$self->{cleanup}}; } # back to the old working directory if needed chdir($old_pwd) if $self->need_workdir(); # # Returning the result # my $result = $self->result; # should not happened return $self->err_result('empty result, it\'s a bug !') unless defined $result; $result->success($rv) unless defined $result->success(); return $result; } sub err_result { my($self, $msg) = @_; my $result = $self->result(); unless(defined $result) { $result = new Cvs::Result::Base; $self->result($result); } $result->success(0); $result->error($msg); return $result; } sub push_cleanup { my($self, $code) = @_; push @{$self->{cleanup}}, $code; } sub restart { my($self) = @_; # restart command $self->{harness}->finish(); $self->{harness}->start(); } sub send { my($self, $data) = @_; if(defined $data) { $self->{data} .= $data; } } sub bind { my($self) = @_; my $context = $self->initial_context(); $context->push_handler ( qr/^cvs \[.* aborted\]: (.+)$/, sub { $self->err_result(shift->[1]); return $context->finish(); } ); } sub default_params { my($self, %param) = @_; foreach(keys %param) { $self->{param}->{$_} ||= $param{$_}; } } sub param { my($self, $param) = @_; if(defined $param && ref $param eq 'HASH') { foreach(keys %$param) { $self->{param}->{$_} = $param->{$_} if exists $param->{$_}; } } return $self->{param} || {}; } sub push_arg { my($self, @args) = @_; push @{$self->{args}}, @args; } sub args { my($self) = @_; return @{$self->{args}||[]}; } sub new_context { my($self) = @_; return Cvs::Command::Context->new(); } sub error { my($self, @msg) = @_; my $package = ref $self || $self; no strict 'refs'; if(@msg) { ${$package."::ERROR"} = join(' ', @msg); return undef; } else { return ${$package."::ERROR"}; } } package Cvs::Command::Context; use strict; use constant LAST => -1; use constant FINISH => -2; use constant CONTINUE => -3; use constant RESCAN => -4; sub new { my($proto) = @_; my $class = ref $proto || $proto; my $self = {}; $self->{rules} = []; bless($self, $class); return $self; } sub last {return -1} sub finish {return -2} sub continue {return -3} sub catched {return shift->{catched}} sub rescan_with { my($self, $context) = @_; if(defined $context) { $self->{rescan_context} = $context; return RESCAN; } return $self->{rescan_context}; } sub push_handler { my($self, $pattern, $code, @args) = @_; push @{$self->{rules}}, [$pattern, $code, @args]; } sub analyse { my($self, $line) = @_; my $match = 0; foreach (@{$self->{rules}}) { my($pattern, $code, @args) = @$_; if(my @match = $line =~ /$pattern/) { $match++; my $rv = &$code([$line, @match], @args); if(defined $rv) { if(ref $rv eq 'Cvs::Command::Context') { # switching to another area return($rv, $match); } elsif($rv eq $self->continue) { next; } elsif($rv eq $self->finish) { return(undef, $match); } elsif($rv eq RESCAN) { my $context = $self->rescan_with(); if(defined $context) { return $context->analyse($line); } } } # if last (default behavior) return($self, $match); } } return($self, $match); } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Export.pm0000644000175000017500000000364410025575650015777 0ustar rsrs00000000000000package Cvs::Command::Export; use strict; use Cvs::Result::Export; use Cvs::Cvsroot; use base qw(Cvs::Command::Base); sub init { my($self, $module, $param) = @_; $self->SUPER::init(@_) or return; $self->default_params ( cvsroot => undef, revision => undef, date => undef, reset => 0 ); $self->param($param); return $self->error('Must define a date or a revision') if(! defined $param->{date} and ! defined $param->{revision}); return $self->error('Mandatory option: module') unless(defined $module); $self->command('export'); $self->push_arg('-d', $self->workdir()) if defined $self->workdir(); $self->push_arg('-A') if $self->param->{reset}; $self->push_arg('-r', $self->param->{revision}) if defined $self->param->{revision}; $self->push_arg('-D', $self->param->{date}) if defined $self->param->{date}; $self->push_arg($module); $self->go_into_workdir(0); my $result = new Cvs::Result::Export; $self->result($result); my $main = $self->new_context(); $self->initial_context($main); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Logout.pm0000644000175000017500000000321307613300263015752 0ustar rsrs00000000000000package Cvs::Command::Logout; use strict; use Cvs::Result::Logout; use base qw(Cvs::Command::Base); sub init { my($self, $param) = @_; $self->SUPER::init(@_) or return; $self->default_params ( cvsroot => undef, ); $self->param($param); if(defined $self->param->{cvsroot}) { my $cvsroot = new Cvs::Cvsroot $self->param->{cvsroot}, %$param; $self->cvsroot($cvsroot); } $self->command('logout'); my $result = new Cvs::Result::Logout; $self->result($result); my $main = $self->new_context(); $self->initial_context($main); $main->push_handler ( qr/can only use pserver method with .logout. command/, sub { # do not fail if login was used with bad method, we don't # care $result->success(1); $main->finish(); } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Commit.pm0000644000175000017500000000653407772313570015755 0ustar rsrs00000000000000package Cvs::Command::Commit; use strict; use Cvs::Result::Commit; use Cvs::Cvsroot; use base qw(Cvs::Command::Base); =head1 NAME Cvs::Command::Commit - commit changes to a CVS repository with Cvs.pm =head1 SYNOPSIS use Cvs; my $cvs = new Cvs 'foo'; open FILE, ">>changed.txt" or die $!; print FILE "appended text\n"; close FILE; my $commit = $cvs->commit ( { recursive => 0, message => 'bar', }, 'changed.txt' ); die $commit->error unless $commit->success; =head1 DESCRIPTION This module provides commit capability for Cvs.pm. =cut sub init { my($self, $param, @files) = @_; $self->SUPER::init(@_) or return; $self->default_params ( recursive => 1, message => "Commit by Cvs.pm $Cvs::VERSION", force => 0, ); $self->param($param); =pod =head2 Parameters =over 4 =item local Only examine files for committing in the current directory. Boolean. =item recursive Examine all subdirectories. Equivalent to the cvs commit -R option. Boolean. =item message A message to commit the file with. Defaults to the Cvs version. =item force Commit a file even if it hasn't been changed. Using force will also turn off recursion unless it's explicitly turned on with the 'recursive' option. Boolean. =item revision Commit to a revision. =back =cut $self->command('commit'); $self->push_arg('-l') if $self->param->{local}; $self->push_arg('-R') if $self->param->{recursive}; $self->push_arg('-f', $self->param->{force}) if $self->param->{force}; $self->push_arg('-m', $self->param->{message}) if defined $self->param->{message}; $self->push_arg('-r', $self->param->{revision}) if defined $self->param->{revision}; if (@files) { $self->push_arg($_) for (@files); } $self->go_into_workdir(1); my $result = new Cvs::Result::Commit; $self->result($result); my $main = $self->new_context(); $self->initial_context($main); my @errors = (); $main->push_handler ( qr/^new revision: (.*?); previous revision: (.*)$/, sub { my ($ver) = @_; $result->set_revision($ver->[2], $ver->[1]); } ); $main->push_handler ( qr/^done$/, sub { $result->success(1); } ); $main->push_handler ( qr/^cvs commit: (.*)$/, sub { push @errors, shift->[1]; } ); $main->push_handler ( qr/^cvs \[commit aborted\]: (.*)$/, sub { push @errors, shift->[1]; $result->success(0); $result->error(join "\n", @errors); } ); return $self; } 1; =pod =head1 SEE ALSO L, L, cvs(1). =head1 AUTHOR Steven Cotton Ecotton@cpan.orgE =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Checkout.pm0000644000175000017500000000343007613300263016247 0ustar rsrs00000000000000package Cvs::Command::Checkout; use strict; use Cvs::Result::Checkout; use Cvs::Cvsroot; use base qw(Cvs::Command::Base); sub init { my($self, $module, $param) = @_; $self->SUPER::init(@_) or return; $self->default_params ( cvsroot => undef, revision => undef, date => undef, reset => 0, ); $self->param($param); return $self->error('Mandatory option: module') unless(defined $module); $self->command('checkout'); $self->push_arg('-d', $self->workdir()) if defined $self->workdir(); $self->push_arg('-A') if $self->param->{reset}; $self->push_arg('-r', $self->param->{revision}) if defined $self->param->{revision}; $self->push_arg('-D', $self->param->{date}) if defined $self->param->{date}; $self->push_arg($module); $self->go_into_workdir(0); my $result = new Cvs::Result::Checkout; $self->result($result); my $main = $self->new_context(); $self->initial_context($main); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Rtag.pm0000644000175000017500000000550207613315666015416 0ustar rsrs00000000000000package Cvs::Command::Rtag; use strict; use Cvs::Result::Rtag; use base qw(Cvs::Command::Base); sub init { my($self, $tag, @modules) = @_; $self->SUPER::init(@_) or return; my $param = {}; if(defined $modules[-1] && ref $modules[-1] eq 'HASH') { $param = pop @modules; } return $self->error('Missing mandatory option for rtag.') unless defined $tag && defined $modules[0]; $self->default_params ( delete => 0, force => 0, branch => 0, release => undef, date => undef, recursive => 1, ); $self->param($param); $self->command('rtag'); $self->push_arg('-d') if $self->param->{delete}; $self->push_arg('-F') if $self->param->{force}; $self->push_arg('-b') if $self->param->{branch}; $self->push_arg('-r', $self->param->{release}) if $self->param->{release}; $self->push_arg('-D', $self->param->{date}) if $self->param->{date}; $self->push_arg('-l') unless $self->param->{recursive}; $self->push_arg($tag, @modules); $self->need_workdir(0); my $main = $self->new_context(); $self->initial_context($main); my $result = new Cvs::Result::Rtag; $self->result($result); my $current_directory = ''; $main->push_handler ( qr/^cvs rtag: (?:Unt|T)agging (.*)\n$/, sub { $current_directory = shift->[1]; } ); $main->push_handler ( qr/^T (.*)\n$/, sub { my($match) = @_; my $file = $current_directory eq '.' ? $match->[1] : $current_directory . '/'. $match->[1]; $result->push_tagged($file); } ); $main->push_handler ( qr/^W (.*?) : (.*)\n$/, sub { my($match) = @_; $result->push_warning($match->[1], $match->[2]); } ); $main->push_handler ( qr/^D (.*)\n$/, sub { my $file = $current_directory eq '.' ? shift->[1] : $current_directory . '/'. shift->[1]; $result->push_untagged($file); } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Update.pm0000644000175000017500000000477607614272276015757 0ustar rsrs00000000000000package Cvs::Command::Update; use strict; use Cvs::Result::Update; use base qw(Cvs::Command::Base); sub init { my($self, @files) = @_; $self->SUPER::init(@_) or return; $self->default_params ( revision => undef, date => undef, reset => 0, send_to_stdout => 0, build_directories => 0, overwrite_local_modified => 0, recursive => 1, ); my $param = ref $files[-1] ? pop @files : {}; $self->param($param); $self->command('update'); $self->push_arg('-A') if $self->param->{reset}; $self->push_arg('-r', $self->param->{revision}) if defined $self->param->{revision}; $self->push_arg('-D', $self->param->{date}) if defined $self->param->{date}; $self->push_arg('-p') if $self->param->{send_to_stdout}; $self->push_arg('-l') unless $self->param->{recursive}; $self->push_arg('-d') if $self->param->{build_directories}; $self->push_arg('-C') if $self->param->{overwrite_local_modified}; $self->push_arg(@files); my $result = new Cvs::Result::Update; $self->result($result); my $main = $self->new_context(); $self->initial_context($main); $main->push_handler ( qr/^([UPARMC\?WG]) (.*)\n$/, sub { my($match) = @_; $result->add_entry($match->[1], $match->[2]); } ); $main->push_handler ( qr/^cvs update: (.*) is no longer in the repository$/, sub { my($match) = @_; # file is gone $result->add_entry('G', $match->[1]); } ); $main->push_handler ( qr/^cvs server: New directory `(.*)' -- ignored$/, sub { $result->push_ignored_directory(shift->[1]); } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Command/Diff.pm0000644000175000017500000001134407613315666015372 0ustar rsrs00000000000000package Cvs::Command::Diff; use strict; use Cvs::Result::DiffList; use Cvs::Result::DiffItem; use base qw(Cvs::Command::Base); sub init { my($self, @file_list) = @_; $self->SUPER::init(@_) or return; $self->default_params ( multiple => 0, recursive => 1, from_date => undef, to_date => undef, from_revision => undef, to_revision => undef, ); my $param = pop @file_list if ref $file_list[-1] eq 'HASH'; $param = $self->param($param||{}); return $self->error('can\'t have more than one source type') if((defined $self->param->{from_date} and defined $self->param->{from_revision})); return $self->error('can\'t have more than one destination type') if((defined $self->param->{to_date} and defined $self->param->{to_revision})); return $self->error('can\'t have a destination without a source') if((defined $self->param->{to_revision} or defined $self->param->{to_date}) and (not defined $self->param->{from_revision} and not defined $self->param->{from_revision})); $self->command('diff'); $self->push_arg('-u2', '-N'); $self->push_arg('-r', $self->param->{from_revision}) if defined $self->param->{from_revision}; $self->push_arg('-D', $self->param->{from_date}) if defined $self->param->{from_date}; $self->push_arg('-r', $self->param->{to_revision}) if defined $self->param->{to_revision}; $self->push_arg('-D', $self->param->{to_date}) if defined $self->param->{to_date}; $self->push_arg(@file_list); my $main = $self->new_context(); $self->initial_context($main); my $resultlist; my $result = $self->err_result('No file in response'); $self->result($result); $main->push_handler ( qr/^Index: (.*)\n$/, sub { my($match) = @_; if($self->param->{multiple}) { unless(defined $resultlist) { $resultlist = new Cvs::Result::DiffList; $self->result($resultlist); } $result = new Cvs::Result::DiffItem; $resultlist->push($result); } else { if($result->isa('Cvs::Result::DiffItem')) { # first item is complete, don't continue return $main->finish() } else { $result = new Cvs::Result::DiffItem; $self->result($result); } } $result->success(1); $result->filename($match->[1]); $result->push_diff($match->[0]); } ); $main->push_handler ( qr/^=+$/, sub { $result->push_diff(shift->[0]); } ); $main->push_handler ( qr/^RCS file: (.*)\n$/, sub { my($match) = @_; $result->rcs_file($match->[1]); $result->push_diff($match->[0]); } ); $main->push_handler ( qr/^retrieving revision .*$/, sub { $result->push_diff(shift->[0]); } ); $main->push_handler ( qr/^diff .*(?:-r([.\d]+)).*(?: -r([.\d]+))?.*$/, sub { my($match) = @_; $result->from_revision($match->[1]); $result->to_revision($match->[2]); $result->push_diff($match->[0]); } ); $main->push_handler ( qr/^cvs server: .*$/, sub { # do nothing } ); $main->push_handler ( qr/^\? /, sub { # do nothing } ); $main->push_handler ( qr/^[\-\+@ ]/, sub { my $line = shift->[0]; if(index($line, '--- /dev/null') == 0) { warn "new"; $result->is_added(1); } elsif(index($line, '+++ /dev/null') == 0) { $result->is_removed(1); } $result->push_diff($line); } ); return $self; } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs/Cvsroot.pm0000644000175000017500000001603610034602077014570 0ustar rsrs00000000000000package Cvs::Cvsroot; use strict; use File::Temp; use base qw(Class::Accessor); Cvs::Cvsroot->mk_accessors(qw(cvsroot method password fingerprint passphrase)); sub new { my($proto, $cvsroot, %conf) = @_; return unless defined $cvsroot; my $class = ref $proto || $proto; my $self = {}; bless($self, $class); $self->{cvsroot} = $cvsroot; if($cvsroot =~ /^\//) { $self->{method} = 'filesystem'; } elsif($cvsroot =~ /^\:pserver\:/) { $self->{method} = 'pserver'; $self->{password} = $conf{password}; } elsif($cvsroot =~ /^(?:.*\@)?.+:.*$/) { $conf{'remote-shell'} ||= 'ssh'; if($conf{'remote-shell'} =~ /(ssh|rsh)$/) { $self->{'remote-shell'} = $conf{'remote-shell'}; $self->{method} = $1; if($self->{method} eq 'ssh') { $self->{password} = $conf{password}; $self->{fingerprint} = $conf{fingerprint}; $self->{passphrase} = $conf{passphrase}; } } else { warn 'unknown remote-shell: ' . $conf{'remote-shell'}; return; } } else { warn "not implemented cvsroot method: $cvsroot"; return; } return $self; } sub bind { my($self, $cmd) = @_; my $debug = $cmd->cvs->debug(); if($debug) { print STDERR "Binding CVSROOT handlers\n"; print STDERR "CVSROOT access method is: $self->{method}\n"; } my $init_context = $cmd->initial_context(); if(defined $self->{'remote-shell'}) { $ENV{CVS_RSH} = $self->{'remote-shell'}; } if($self->{method} eq 'pserver') { $init_context->push_handler ( qr/^cvs .*: used empty password; /, sub { if(defined $self->{password}) { if($cmd->cvs->login->success()) { # The former command failed because it wasn't # logged. So we need to relaunch it internally $cmd->restart(); } else { $cmd->err_result('pserver login failure'); return $init_context->finish(); } } else { $cmd->err_result('you have to login.'); return $init_context->finish(); } } ); } elsif($self->{method} eq 'ssh') { # without pty, ssh call the ssh-askpass program to grab needed # informations from user. In batch mode it's not possible, so # we rewrite an ssh-askpass in a shell script stored in a # temporary file and we tell ssh to call it. my($fh, $file) = File::Temp::tmpnam() or die "can't create a temporary file"; print STDERR "Creating askpass script `$file'\n" if $debug; chmod(0700, $file); $fh->print("#!/bin/sh\n"); $fh->print("echo \$1|grep -iq password&&echo $self->{password}&&exit\n"); $fh->print("echo \$1|grep -iq passphrase&&echo $self->{passphrase}&&exit\n"); $fh->print("echo yes\n"); $fh->close(); $cmd->push_cleanup(sub { print STDERR "Deleting askpass script `$file'\n" if $debug; unlink $file }); $ENV{SSH_ASKPASS} = $file; # ssh doesn't tell ssh-askpass until the DISPLAY environment # isn't set, so we have to set it to something (see ssh's # manual for more details). $ENV{DISPLAY} = ''; my $ssh_context = $cmd->new_context(); my $fingerprint; # building a combo pattern for all ssh error starting with the # string "ssh: " my $error_patterns = join ('|', '.*: Name or service not known', 'connect to address [\d.]+ port \d+: Connection refused', ); $init_context->push_handler ( qr/^ssh: (?:$error_patterns)/, sub { $cmd->err_result(shift->[0]); return $init_context->finish(); } ); $init_context->push_handler ( qr/Could not create directory/, sub { # Hint: this can happened where the home directory isn't writable } ); $init_context->push_handler ( qr/^Enter passphrase for key/, sub { $cmd->send($self->{passphrase}); } ); $init_context->push_handler ( # maybe ssh version defendant... qr/'s password:/, sub { $cmd->send("$self->{password}\n"); } ); $init_context->push_handler ( qr/Permission denied/, sub { $cmd->err_result('ssh: authentication failure'); return $init_context->finish(); } ); $init_context->push_handler ( qr/^The authenticity of host .* can't be established\./, sub { return $ssh_context; } ); $ssh_context->push_handler ( qr/key fingerprint is ([a-f\d:]+)\./, sub { $fingerprint = shift->[1]; } ); $ssh_context->push_handler ( qr/^Are you sure you want to continue connecting/, sub { if(defined $fingerprint && defined $self->{fingerprint}) { if($fingerprint eq $self->{fingerprint}) { $cmd->send("yes\n"); } else { $cmd->send("no\n"); } } else { $cmd->send("yes\n"); } } ); $ssh_context->push_handler ( qr/Host key verification failed\./, sub { $cmd->err_result('ssh: '.shift->[0]); return $ssh_context->finish(); } ); $ssh_context->push_handler ( qr/Warning: Permanently added .* to the list of known hosts\./, sub { # fallback to initial context return $init_context; } ); } } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/lib/Cvs.pm0000644000175000017500000002370110155613676013141 0ustar rsrs00000000000000package Cvs; use strict; use Carp; use Cwd; use FileHandle; use File::Path qw(rmtree); use Cvs::Cvsroot; use base qw(Class::Accessor); use vars qw($AUTOLOAD %LOADED); $Cvs::VERSION = 0.07; Cvs->mk_accessors(qw(debug pwd workdir)); =pod =head1 NAME Cvs - Object oriented interface to the CVS command =head1 SYNOPSIS use Cvs; my $cvs = new Cvs ( '/path/to/repository/for/module', cvsroot => ':pserver:user@host:/path/to/cvs', password => 'secret' ) or die $Cvs::ERROR; $cvs->checkout('module'); ... my $status = $cvs->status('file'); if($status->is_modified) { $cvs->commit('file'); } $cvs->release({delete_after => 1}); $cvs->logout(); =head1 DESCRIPTION bla bla =head1 LEGACY CVS METHODS =head2 new Cvs = new Cvs ["workdir"] [key => "value" [, ...]]; my $obj = new Cvs "workdir"; my $obj = new Cvs "workdir", cvsroot => "/path/to/cvsroot"; my $obj = new Cvs cvsroot => ":pserver:user\@host:/path/to/cvs"; Create a new Cvs object for the repository given in argument. Note that the working directory doesn't need to already exist. Allowed parameters are: =over 4 =item workdir Path to the working directory. You don't need it if you plan to use only remote commands like rdiff or rtag. =item cvsroot Address of the cvsroot. See the Cvs::Cvsroot module documentation for more information on supported CVSROOT. Note that if you don't supply a cvs root but a working directory, Cvs will try to guess the CVSROOT value. You still need to supply password and others authentication values. If Cvs can't determine the CVSROOT value, an error will be thrown and the object will not be created. =item password, passphrase, ... All options supported by Cvs::Cvsroot are supported here. Please see Cvs::Cvsroot documentation for more details. =back =head2 checkout Cvs::Result::Checkout = $obj->checkout("module", {key => "value"}); Checkout the module "module" in the repository (the one that served to create the Cvs object) from the cvsroot given in parameter. Allowed parameters are: =over 4 =item reset Boolean value used to reset any sticky tags, dates or options (See the -A cvs checkout option). =item revision Specify the revision to checkout the module (See the -r cvs checkout option). =item date Specify the date from when to checkout the module (See the -D cvs checkout option). =back L. =head2 update Cvs::Result::Update = $cvs->update(); L. =head2 status Cvs::Result::StatusItem = $cvs->status("file"); Cvs::Result::StatusList = $cvs->status("file1", "file2", {multiple => 1}); Get the status of one of more files. Allowed parameters are: =over 4 =item multiple Boolean value that specify the type of object returned. If true, a Cvs::Result::StatusList object is returned, and status on more than one files can be handled. If false, a Cvs::Result::StatusItem object is return and only one file status can be handled (the first one if several). =item recursive If a directory is supplied, process it recursively (Default true). =back L, L =head2 diff Cvs::Result::DiffItem = $cvs->diff(); Cvs::Result::DiffList = $cvs->diff({multiple => 1}); L, L. =head2 rdiff Cvs::Result::RdiffList = $cvs->rdiff("module", {from_revision => $rev}); L. =head2 log Cvs::Result::Log = $cvs->log(); L. =head2 tag Cvs::Result::Tag = $cvs->tag("tag"); L. =head2 rtag Cvs::Result::Tag = $cvs->rtag("module", "tag"); L. =head2 release Cvs::Result::Release = $cvs->release(); Cvs::Result::Release = $cvs->release('module', ..., {force => 1}); Call the release command. If call with no directories to release, self repository will be released. =over 4 =item force Boolean value that activate a forced directory release even if some files was not committed. Defaults to false. =item delete_after Boolean value that activate directory removal after a release. Default to false. =back L =head2 export Cvs::Result::Export = $obj->export("module", {key => "value"}); Checkout the module "module" in the repository (the one that served to create the Cvs object) from the cvsroot given in parameter, but without the CVS administrative directories. Allowed parameters are the same as for checkout. However, one of the options 'revision' or 'date' must be specified. =head1 OTHERS METHODS =cut sub new { my $proto = shift; my $class = ref $proto || $proto; my $self = {}; bless($self, $class); my $workdir = @_ % 2 ? shift : undef; my %args = @_; $self->debug($args{debug} or 0); # we need a full path if(defined $workdir) { $workdir =~ s/\/$//g; if($workdir =~ /^(.*\/)(.*)/) { $self->workdir($2); if(index($1, '/') == 0) { $self->pwd($1); } else { $self->pwd(cwd().'/'.$1); } } else { $self->workdir($workdir); $self->pwd(cwd().'/'); } unless(-d $self->pwd()) { $Cvs::ERROR = "Directory doesn't exists: ".$self->pwd(); return; } if(not defined $args{cvsroot} and -f join('/', $self->working_directory(), 'CVS/Root')) { # trying to guess the cvsroot if working directory # exists... this will not work if cvsroot is - for example - # on a remote ssh server an need an interaction like a # password prompt my $_conf = new FileHandle join('/', $self->working_directory(), 'CVS/Root'); if(defined $_conf) { $args{cvsroot} = $_conf->getline(); chomp($args{cvsroot}) if defined $args{cvsroot}; } } } else { $self->pwd(cwd().'/'); } if(defined $args{cvsroot}) { $self->cvsroot($args{cvsroot}, %args) or do { $Cvs::ERROR = $self->error(); return; }; } else { $Cvs::ERROR = 'Can\'t find CVSROOT'; return; } return $self; } =pod =head2 module_list my @modules = $cvs->module_list(); Returns the list of all modules which can be riched on the CVSROOT. This method do something that cvs doesn't implement by itself, we use a little trick to get this list, and this perhaps not work with all cvs versions. Do not mix up this method with the "-c" argument of the cvs' checkout sub-command. =cut sub module_list { my($self) = @_; my $cvsroot = $self->cvsroot() or return $self->error('Cannot determine CVSROOT'); my $tmpdir = "/tmp/cvs-$$-".time(); mkdir($tmpdir, 0700) or return $self->error("Cannot create directory: $tmpdir"); chdir($tmpdir) or return $self->error("Cannot chdir to directory: $tmpdir"); mkdir("$tmpdir/CVS") or return $self->error("Cannot create directory: $tmpdir/CVS"); # create the Root control file my $root = new FileHandle ">$tmpdir/CVS/Root" or return $self->error("Cannot create file: $tmpdir/CVS/Root"); $root->print($cvsroot->cvsroot() . "\n"); $root->close(); # create an empty Repository control file my $repository = new FileHandle ">$tmpdir/CVS/Repository" or return $self->error("Cannot create file: $tmpdir/CVS/Repository"); $repository->print("\n"); $repository->close(); # keep some parameters my $old_pwd = $self->pwd(); my $old_workdir = $self->workdir(); $tmpdir =~ /^(.*\/)(.*)$/; $self->pwd($1); $self->workdir($2); # do the trick my $result = $self->update({send_to_stdout => 1, build_directories => 1}); # cleanup and restore parameters rmtree($tmpdir); $self->pwd($old_pwd); $self->workdir($old_workdir); return $self->error($result->error()) unless $result->success(); return $result->ignored_directories(); } =pod =head1 ACCESSORS =head2 cvsroot Returns the Cvs::Cvsroot object. =cut sub cvsroot { my($self, $cvsroot, %args) = @_; if(defined $cvsroot) { $self->{cvsroot} = new Cvs::Cvsroot $cvsroot, %args or return $self->error('Cannot init cvsroot object'); } return $self->{cvsroot}; } =pod =head2 working_directory Returns the full path of the working directory =cut sub working_directory { my($self) = @_; return $self->pwd() . $self->workdir(); } sub AUTOLOAD { my $self = shift; my $name = $AUTOLOAD; $name =~ s/.*://; return if $name eq 'DESTROY'; my $module = $self->load($name); my $cmd = $module->new($self, @_) or return $self->error($module->error()); return $cmd->run(); } sub load { my($self, $name) = @_; $name = ucfirst $name; require "Cvs/Command/${name}.pm"; return "Cvs::Command::$name"; } sub error { my($self, @msg) = @_; if(@msg) { $self->{_error} = join(' ', @msg); return undef; } else { return $self->{_error}; } } 1; =pod =head1 LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/MANIFEST0000644000175000017500000000300610025602250012405 0ustar rsrs00000000000000lib/Cvs/Command/Checkout.pm lib/Cvs/Command/Commit.pm lib/Cvs/Command/Base.pm lib/Cvs/Command/Login.pm lib/Cvs/Command/Diff.pm lib/Cvs/Command/Export.pm lib/Cvs/Command/Logout.pm lib/Cvs/Command/Rdiff.pm lib/Cvs/Command/Release.pm lib/Cvs/Command/Rtag.pm lib/Cvs/Command/Status.pm lib/Cvs/Command/Tag.pm lib/Cvs/Command/Update.pm lib/Cvs/Cvsroot.pm lib/Cvs/Result/Checkout.pm lib/Cvs/Result/Commit.pm lib/Cvs/Result/Base.pm lib/Cvs/Result/DiffItem.pm lib/Cvs/Result/DiffList.pm lib/Cvs/Result/Export.pm lib/Cvs/Result/Login.pm lib/Cvs/Result/Logout.pm lib/Cvs/Result/RdiffItem.pm lib/Cvs/Result/RdiffList.pm lib/Cvs/Result/Release.pm lib/Cvs/Result/Rtag.pm lib/Cvs/Result/StatusItem.pm lib/Cvs/Result/StatusList.pm lib/Cvs/Result/Tag.pm lib/Cvs/Result/Update.pm lib/Cvs.pm MANIFEST Makefile.PL README t/00checkout.t t/05commit.t t/10status.t t/20tag.t t/21rtag.t t/30update.t t/40diff.t t/50export.t t/90release.t cvs/CVSROOT/checkoutlist cvs/CVSROOT/checkoutlist,v cvs/CVSROOT/commitinfo cvs/CVSROOT/commitinfo,v cvs/CVSROOT/config cvs/CVSROOT/config,v cvs/CVSROOT/cvswrappers cvs/CVSROOT/cvswrappers,v cvs/CVSROOT/editinfo cvs/CVSROOT/editinfo,v cvs/CVSROOT/history cvs/CVSROOT/loginfo cvs/CVSROOT/loginfo,v cvs/CVSROOT/modules cvs/CVSROOT/modules,v cvs/CVSROOT/notify cvs/CVSROOT/notify,v cvs/CVSROOT/rcsinfo cvs/CVSROOT/rcsinfo,v cvs/CVSROOT/taginfo cvs/CVSROOT/taginfo,v cvs/CVSROOT/val-tags cvs/CVSROOT/verifymsg cvs/CVSROOT/verifymsg,v cvs/test/test.txt,v META.yml Module meta-data (added by MakeMaker) Cvs-0.07/README0000644000175000017500000000231710155613703012151 0ustar rsrs00000000000000Cvs version 0.07 ================ This module is a wrapper around the cvs command with an object oriented interface. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: IO::Pty, IPC::Run, Class::Accessor, FileHandle, File::Temp... NAME Cvs - Object oriented interface to the CVS command LICENCE This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA COPYRIGHT Copyright (C) 2003 - Olivier Poitrey Cvs-0.07/META.yml0000644000175000017500000000102110155614544012535 0ustar rsrs00000000000000# http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Cvs version: 0.07 version_from: lib/Cvs.pm installdirs: site requires: Class::Accessor: 0.17 Cwd: 2.04 File::Temp: 0.12 FileHandle: 2.0 IO::Pty: 1.02 IPC::Run: 0.74 distribution_type: module generated_by: ExtUtils::MakeMaker version 6.17 Cvs-0.07/Makefile.PL0000644000175000017500000000077507744703534013265 0ustar rsrs00000000000000use strict; use ExtUtils::MakeMaker; WriteMakefile ( NAME => 'Cvs', DISTNAME => 'Cvs', VERSION_FROM => 'lib/Cvs.pm', # finds $VERSION PMLIBDIRS => ['lib'], PREREQ_PM => { 'IO::Pty' => '1.02', 'IPC::Run' => '0.74', 'Class::Accessor' => '0.17', 'FileHandle' => '2.0', 'File::Temp' => '0.12', 'Cwd' => '2.04', }, AUTHOR => 'Olivier Poitrey ', );