It's not always as straight forward as checking out the code again so here's a batch script to recursively update the CVS\Root file with the new CVSROOT.
Synopsis: updateCVSRoot.bat <WORKSPACEDIR> <CVSROOT>
@echo off
REM This script is used to update CVS Root in checked out directory
REM SYNOPSIS: updateCVSRoot.bat <WORKSPACEDIR> <CVSROOT>
REM Check arguments
if "%2" == "" goto MISSINGARGUMENT
REM Check if workspace directory exist
IF NOT EXIST %1 GOTO NOWORKSPACEDIR
REM Setup variables
SET W_DRIVE=%~d1
SET W_PATH=%~dp1
REM Enter drive and directory for the root of CVS checked out directory
%W_DRIVE%
cd %W_PATH%
REM Find all Root files and replace with CVSROOT
for /f "tokens=*" %%a in ('dir Root /b /s') do (
echo %2> "%%a"
)
echo Done!
exit /b 0
:MISSINGARGUMENT
printf "Usage: %~n0 <WORKSPACEDIR> <CVSROOT>\n"
printf " WORKSPACEDIR Root directory to search for filenames called Root\n"
printf " CVSROOT Fully qualified CVSROOT\n"
printf "\n"
printf "Example: %~n0 c:\\\\cvsdir :sserver:username@cvs.localdomain:/my/cvsroot\n"
printf "\n"
exit /b 1
:NOWORKSPACEDIR
echo ERROR: %1 doesn't exist
echo.
exit /b 1
No comments:
Post a Comment