info-cvs
[Top][All Lists]
Advanced

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

Re: renaming a directory in the checkout / recursive add and commit for


From: Alexander Welti
Subject: Re: renaming a directory in the checkout / recursive add and commit for all subdirs
Date: Wed, 19 Sep 2001 18:39:19 +0200

i received a really cool trick for my problem:
go to the repository directly (have a backup copy)
rename the desired directory;
do a fresh checkout and everything works fine;

thanks
alex


"John Minnihan" <address@hidden> wrote in message
news:address@hidden
> This silly little batch file (it's showing its age) does the recursive
> add trick:
> ==========================
> @ECHO OFF
>
> SETLOCAL
> REM Set up a string that specifies all files we want to check in
> SET cvs_add_list=*.cpp,*.c,*.pl,*.html,*.xml,*.txt,*.java,*.pm
>
>
> :parse_options
> if NOT "%1"=="/?" goto add_tree_head
> ECHO Adds a directory tree of files to CVS
> ECHO.
> ECHO
> ADD_TREE [directory]
> ECHO.
> ECHO If directory is passed, then that directory will be used as
> ECHO the root directory for the add operation - that directory
> ECHO and all sub-directories will be added.
> ECHO.
> ECHO Files are added according to the filter stored in the environment
> ECHO variable ADD_TREE_FILTER.  If this is unset, the default value of
> ECHO %cvs_add_list%
> ECHO is used...
> ECHO.
> ECHO Files are added in each sub-directory.
> ECHO There is no way (today!) to specify exception files or exception
> directories.
> ECHO.
> ECHO Author: John Minnihan
> ECHO Author: Nick Furness
>
> GOTO :EOF
>
> :add_tree_head
> set head_dir= "%1"
> IF NOT DEFINED head_dir echo Adding subtree only...
> IF NOT DEFINED head_dir goto add_subtree
> IF NOT EXIST %1 @ECHO Bad File: %1
> IF NOT EXIST %1 GOTO :EOF
>
> cvs add %1
> CD %1
>
> goto add_remainder_of_subtree
>
> :add_subtree
> @CD %1
>
> :add_remainder_of_subtree
> ECHO.
> ECHO.
> ECHO.
> CD
> ECHO *********************************************************
> ECHO Adding directories...
> ECHO *********************************************************
> FOR /D %%i in (*) DO IF /I NOT "%%i"=="CVS" cvs add "%%i"
> ECHO *********************************************************
>
> IF DEFINED add_tree_filter set cvs_add_list=%add_tree_filter%
>
> REM Note that because the cvs_add_list might not only contain
> REM wildcard search expressions, we could attempt to add a file
> REM that isn't there.  Silly, but true.  So we'll check.
>
> ECHO Adding files...
> ECHO *********************************************************
> FOR %%i IN (%cvs_add_list%) DO IF EXIST "%%i" cvs add "%%i"
> ECHO *********************************************************
>
> REM And recurse for all the directories below...
> FOR /D %%i IN (*) DO IF /I NOT "%%i"=="CVS" call :add_subtree "%%i"
> CD ..
>
> GOTO :EOF
>
> ENDLOCAL
> ======================================
>
> address@hidden wrote:
>
> > hi!
> >
> > i would like to rename a directory (containing tons of subdirs and
files) in
> > my checkout and have that change applied to the repository.
> >
> > can i simply rename the dir;
> > check it in (is there a recursive cvs add by the way?)
> > and remove the dir in the repository (how? reqursively?)
> >
> > thanks,
> > alex
> >
> > --
> >
> > Alexander Welti, address@hidden, A-6900 Bregenz
> >
>
>
> --
> John Minnihan
> mailto:address@hidden
> http://www.freepository.com
>
>




reply via email to

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