The script isn't doing what you think it's doing.
Fundamentally, I've got a script that swaps out CVS's control files into a holding
directory, or swaps them out from a holding directory. And, there's two others for
adding a new repository directory into the system (one for a repository that
already has a version of the module, one for a repository that doesn't.).
Wrapping or not, at some point I'm going to want to add a new sub-dir to an
existing project.
The first time I do this, no problem. The directory isn't in any of the
repositories, so it goes in fine.
Later, I run the switch script to switch to another repository's view of CVS.
Currently, the holding directories are stored as sub-dir's of CVS; this was chosen
as (A), it is the only place ignored by CVS, and (B) it doesn't clutter any user
visable area. But this means that the second repository, if I want to add the
sub-dir to it, will complain that there already is a version in that directory,
but then complain that there are no admin files in there.
The solution? Well, if I put the holding directories elsewhere, I can then always
try an 'rmdir CVS'. But that means that every directory will have a new sub-dir
that needs to be ignored; that means that every directory will need a .cvsignore
created and maintained, some of which will be ignored by CVS, others that will NOT
be ignored by CVS. That's looking to be a nightmare.
Noel L Yap wrote:
>
> Well, assuming you're wrapping CVS, why not just move the CVS subdirectory out
> of the way before the actual "cvs add subdir" gets executed. After it's done,
> you can move the CVS subdirectory back.
>
> Greg's change will maintain the recursive behaviour of "cvs add" (as it should).
> It is mainly geared towards not having to explicitly "cvs add" a subdirectory
> (ie "cvs add subdir" will be implied when you "cvs add file" and the file's
> directory is not already in the repo).
>
> Noel
>
> [EMAIL PROTECTED] on 04/18/2000 11:30:22 AM
>
> To: [EMAIL PROTECTED]
> cc: [EMAIL PROTECTED]
> Subject: Re: Help: Scripts to change repositories
>
> Whether or not there is an explicit need to do 'cvs add subdir', if I have a
> directory tree that has CVS subdirs, that do not have CVS control files in them,
> will a 'cvs add' on the main dir work or not?
>
> With the current system, it will not.
>
> Incidently, I also am in favor of a different command ('radd', for recursive
> add?)
> that has zero chance of breaking other programs, or removing the 'add' command
> for
> two releases before putting it back in (think 'rlog'). Or, adding the '-R' flag
> to
> 'add', and just saying that the default for add is '-l'.
>
> (So saying because recursive add will break my scripts. But since they don't
> work
> right anyways, :-).
>
> (Incidently, my earlier versions used import, rather than checking out the root
> and adding a directory. That was a pain, as I had to always remember to clean
> out
> the crud (make clean). before using them. It was only a day or two ago that I
> actually needed to make a new module, and discovered that 'add' checks for, and
> aborts, if it finds a CVS subdir without any regards to the presense of CVS
> control files.)
>
> Noel L Yap wrote:
> >
> > Greg Woods is working on removing the need to "cvs add subdir". There was a
> lot
> > of traffic about it a couple of months ago. I don't know where that
> development
> > stands now.
> >
> > I know this info doesn't help right now. The only other alternative I know is
> > if you make the change yourself locally. Any global change will definitely
> > conflict with Greg's potential, pending changes.
> >
> > Noel
> >
> > [EMAIL PROTECTED] on 04/17/2000 04:54:52 PM
> >
> > To: [EMAIL PROTECTED]
> > cc: (bcc: Noel L Yap)
> > Subject: Help: Scripts to change repositories
> >
> > I'm working on some scripts to allow people to use multiple repositories
> > with a single set of files, and I've run into a problem.
> >
> > 'cvs add subdir' will fail to work if there is a CVS directory in
> > subdir. No test is made to see if there is no control files in subdir or
> > not, only if the CVS directory exists.
> >
> > In other words, my scripts work fine, changing the cvs repository
> > information around, until you add a new subdirectory. Then, it can be
> > added to one of your repositories, only.
> >
> > The only work-around that I can see at the moment is to not store the
> > 'extra repository' information in the CVS directory, but in another
> > direcctory, and to be 'rmdir'/'mkdir'-ing CVS directories a lot. This
> > has the disadvantage of exposing at least one new directory into public
> > view.
> >
> > Is there any chance that we can get 'cvs add subdir' to say 'Hey,
> > subdir/CVS does exist, but is not in the repository and has no
> > Repository, Root, Entries, etc -- lets create those admin files and add
> > subdir to the repository'?
> >
> > Michael