[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)

From: root
Subject: (no subject)
Date: Mon, 13 Aug 2001 05:13:12 -0400

>From address@hidden  Fri Feb  9 17:55:43 2001
>Return-Path: <address@hidden>
Received: from (address@hidden [])
        by (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id 
        for <address@hidden>; Fri, 9 Feb 2001 17:55:37 +0900
Received: from localhost ([]
        by with esmtp (Exim 3.16 #1 (Debian))
        id 14R9Gl-000846-00; Fri, 09 Feb 2001 03:51:07 -0500
Received: from ([]
        by with esmtp (Exim 3.16 #1 (Debian))
        id 14R9F4-00081O-00
        for <address@hidden>; Fri, 09 Feb 2001 03:49:22 -0500
Received: from (IDENT:address@hidden 
        by (8.9.3/8.9.3) with ESMTP id IAA26182;
        Fri, 9 Feb 2001 08:49:04 GMT
Received: from MOA ( [])
        by (8.8.7/8.8.7) with ESMTP id IAA23047;
        Fri, 9 Feb 2001 08:48:54 GMT
To: "Deaver, Carl" <address@hidden>
Cc: address@hidden
Subject: Re: Transferring the CVS to another hosts
References: <address@hidden>
From: Martin Tomes <address@hidden>
In-Reply-To: <address@hidden>
Message-ID: <address@hidden>
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=_webhead-7125-997693983-0001-2"
Sender: address@hidden
Errors-To: address@hidden
X-BeenThere: address@hidden
X-Mailman-Version: 2.0
Precedence: bulk
List-Help: <mailto:address@hidden>
List-Post: <mailto:address@hidden>
List-Subscribe: <>,
List-Id: Announcements and discussions for the CVS version control system 
List-Unsubscribe: <>,
List-Archive: <>
Date: 09 Feb 2001 08:48:54 +0000
Status: O
Content-Length: 5524
Lines: 29

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

>>>>> "Carl" == Deaver, Carl <address@hidden> writes:

    Carl> Inside
    Carl> that CVS folder are 4 files. 2 of which are ROOT and Repository.
    Carl> Inside each one of these ROOT files contains information as to who
    Carl> checked out these modules, which includes the server name. for
    Carl> example:
    Carl> :pserver:address@hidden:/data/sndev003/02/home/cvsop/qc

Find attached a perl program for changing CVS server.

It was written to change from a machine called
to  I also changed the path on the repository
from /usr/local/repository to /cvs/controls.  Some of the checkouts had full
path names in the Repository file which started with /usr/local/repository,
this script strips that off the path to make it relative to the one in Root.

You will have to change the names and paths, but variations of this have been
used to move repositories several times.  You *must* test it thoroughly and
back up your checkouts before running it.  Users either need Perl installed,
or if you are using windows you can buy the ActiveState PerlDev kit to turn it
into a .exe

Martin Tomes


Content-Type: application/octet-stream
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
Content-Description: changeserver

#line 14
# This program changes the server name in the CVS/Root files.
# Need the full path from the root of this drive for the Entering directory
# messages.
use strict;

my $rootd=qx{cd};
$rootd =~ s/[a-zA-Z]://;
$rootd =~ s/\\/\//g;
my @dir_stack;
my @rdir_stack;
sub pushd {
    my($d) = @_;
    my($cwd) = qx{cd};
    push(@dir_stack, $cwd);
    # Want a relative one as well
    push(@rdir_stack, $d);
    # This is for emacs compilation mode so it knows which directory files are
    # in.
    my $i;
#    print "\nchserver: Entering directory `" . $rootd . "/";
    for ($i=0; $i<=($#rdir_stack-1); $i++) {
        # Ignore path name . as it is superfluous.
#       print $rdir_stack[$i] . "/" if ($rdir_stack[$i] ne ".");
#    print $rdir_stack[$#dir_stack] . "'\n";
    chdir($d) || die "Could not chdir($d)\n";

sub popd {
    my $d = pop(@dir_stack);
    chdir($d) || die "Could not chdir($d)\n";

sub dodir {
    my ($dir, $level) = @_;
    if (!opendir(D, $dir)) {
        print "Failed to open $dir\n";
    my(@allfiles)=sort grep(!/^\.\.?$/,readdir(D));
    foreach my $file (@allfiles) {
        if (-d "$dir/$file") {
            if (lc($file) eq "cvs") {
                print "$dir";

                if (!-f "Root") {
                    print "WARNING: Didn't find $dir/$file/Root\n";
                } else {
                    my $haschanged = 0;
                    if (open(IN, "<Root")) {
                        if (open(OUT, ">tmp")) {
                            while (<IN>) {
                              if (/merlot/) {
                                $haschanged = 1;
                              print OUT;
                        if ($haschanged) {
                          unlink "Root";
                          rename "tmp", "Root";
                          print " (Root)";
                        } else {
                          unlink "tmp";

                # Make sure that the path in this file is relative to the
                # repository root.
                if (!-f "Repository") {
                    print "WARNING: Didn't find $dir/$file/Repository\n";
                } else {
                    my $haschanged = 0;
                    if (open(IN, "<Repository")) {
                        if (open(OUT, ">tmp")) {
                            while (<IN>) {
                              if (/^\/usr\/local\/repository\//) {
                                $haschanged = 1;
                              if (/^\/usr\/local\/us_repository\//) {
                                $haschanged = 1;
                              print OUT;
                        if ($haschanged) {
                          unlink "Repository";
                          rename "tmp", "Repository";
                          print " (Repository)";
                        } else {
                          unlink "tmp";

                print "\n";
            } else {
                &dodir("$dir/$file", $level + 1);

&dodir(".", 1);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]