Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jan 2000 00:01:38 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Wilko Bulte <wilko@yedi.iaf.nl>
Cc:        Ollivier Robert <roberto@keltia.freenix.fr>, FreeBSD hackers list <FreeBSD-hackers@freebsd.org>
Subject:   Re: moving CVS repository 
Message-ID:  <20000109160138.EB9191CC6@overcee.netplex.com.au>
In-Reply-To: Message from Wilko Bulte <wilko@yedi.iaf.nl>  of "Sun, 09 Jan 2000 16:30:25 %2B0100." <20000109163025.A63612@yedi.iaf.nl> 

next in thread | previous in thread | raw e-mail | index | archive | help
Wilko Bulte wrote:
> On Sun, Jan 09, 2000 at 10:27:16PM +0800, Peter Wemm wrote:
> > Ollivier Robert wrote:
> > > According to Wilko Bulte:
> > > > Is there any way, short of running a fresh cvs co, to correct this?
> > > 
> > > *NOT TESTED*
> > > 
> > > Something along the lines of
> > > 
> > > perl -ni -e 's</old/path></new/path>' **/{Root,Repository}  (if using zsh
    )
> > > 
> > > or 
> > > 
> > > find . \( -name Root -o -name Repository \) -path \*CVS\* | xargs perl -n
    i ..
> >     .
> > > 
> 
> > Note that there is an important change in CVS behavior in 1.10.7 (in -curre
    nt
> > and -stable) relative to 1.10.  CVS used to have:
> > 
> > CVS/Root:	/local/CVSfoo
> > CVS/Repostory:	/local/CVSfoo/path/to/directory
> > 
> > Now it has:
> > CVS/Root:	/local/CVSfoo
> > CVS/Repostory:	path/to/directory
> > 
> > ie: Repository is now *relative* to the Root, and does not duplicate the Ro
    ot
> > path.
> 
> Allow me a potentially stupid question: why do the Root files exist at all?
> I mean, assuming you cvs -q <cmd> with CVSROOT set to the right place you
> should be able to work on your checked-out tree without problems. Or am I
> missing the glaringly obvious here? 

What if you have two repositories from two different cvs trees?  what would
happen if you forgot to change $CVSROOT when switching from one to the other?

IMHO, It's not such a hot idea to leave $CVSROOT set these days.  Use cvs -d
when doing the initial checkout and then let each checkout identify itself.

> Maybe the same applies to the Repository files?

No, Repository tells us the path for "this" directory to the repostory.  eg:

cd /tmp
cvs -d /home/ncvs checkout ls

Now the name "/tmp/ls" gives no clue where it "fits" into the repository -
that's where the Repository files come in.  They contain "bin/ls" so that
cvs can find where the directory fits.  "Root" contains "/home/ncvs" so
that cvs knows which repository it came from.

> And if they have to exist, why are they repeated everywhere?

Because you can have multiple cvsroot's in a single heirarchy.

> > Also, 1.10.7 has "multiroot" capability.  If you descend a tree with differ
    ent
> > CVS/Root's, it will do the expected thing.  That means if you have a part l
    ocal
> > tree and a part remote tree, a 'cvs update' will switch to and from remote
> > mode as required.  This can be a bit of a suprise if you are not expecting 
    it!
> > 
> > One other thing..  cvs -d new-root-path  *unconditionally* overrides *all*
> > CVS/Root files.  The CVS_IGNORE_REMOTE_ROOT hack is gone and no longer requ
    ired.
> > cvs now assumes that if you override the root with -d, then you know what y
    ou
> > are doing.  ie: you can check out from /local/mycvs and commit with
> 
> This sounds like I would expect (but I have never commited anything to a cvs
> tree so I have not shot myself in the foot here ;-)

Yes, but it never worked this way until recently or if you compiled in
relative Repository mode.  And even then you couldn't override the cvsroot
path with -d.  I guess the cvs folks feel that enough people know how to handle
cvs that it's safe enough to supply rope and to hope that enough people will be
around to prevent accidental hangings. :-]

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000109160138.EB9191CC6>