info-cvs
[Top][All Lists]
Advanced

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

Re: Adding and Committing multiple new directories and files


From: Zieg, Mark
Subject: Re: Adding and Committing multiple new directories and files
Date: Thu, 08 Aug 2002 09:15:16 -0400

> [cvs import] is only correct if one wishes to add directories
> and files that are not intermixed with one's existing archive,
> i.e. if I add a number of directories within my archive,
> complete with new files, the time will come to add and commit
> them all.  Doing an import is probably not appropriate for
> this, unless I misunderstand import.
>
>   [...]
>
> Thanks for the reply.  I created a test repository and tried the
> import method as Shlomo suggested but it does not seem to work
> correctly.  Unfortunately, using a GUI client is not possible
> and also I would like to script this operation.  Still looking
> for ideas?  Anyone have any?

This may be overly simplistic, but it seems that a very simple script would
suffice, based on the fact that "cvs add" returns a "failure" exit code if
you try to re-add an existing file.

To wit:

    for i in `find .`
    do 
        cvs add $i && cvs commit -m "batch addition" $i
    done

(initially, I'd done some grepping of the "find" output to exclude ".",
"CVS", etc, but it turned out after testing that "cvs add" fails on those
automatically, making the script even shorter)

Comments?



reply via email to

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