Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Changing CVS roots in existing checkouts

SO I got a chunk of CVS and the server has been moved. See this for the Unix version.

I am on windows, with no Cygwin (in this machine).


use strict;
use Cwd;
use File::Find;
use File::Copy;
use File::Basename;

my $NEW_CVSROOT = ':pserver:xxxx.xxxxxnull@xxxxx:/cvs/xxxxxx';
my $RootFolder = cwd();
&find( \&Filter_OverwriteRoot, $RootFolder );
warn "$0 Process complete. Terminating...\n";
exit(0);

#########################################

sub Filter_OverwriteRoot # ()
{
my $fileSpec = $File::Find::name;
my $fileName = $_;

# if a file...
if ( -f $fileSpec )
{
# Root is done
if ( $fileName =~ /^Root$/i )
{
print "update $File::Find::dir $fileName \n";
open (FILE, ">$fileName") || die "Can't open $fileName: $!\n";
print FILE $NEW_CVSROOT . "\n";
close(FILE);
}

}
}

Run this in the root folder for the checked out code. Seems to work…

MAKE SURE YOU ONLY HAVE ONE ROOT LINE PER CVS/Root file! The other solution replaces them all. Mine doesn’t.


Leave a Reply