Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.6 KiB

  1. @if "%_echo%"=="" echo off
  2. setlocal
  3. if "%1" == "" goto Usage
  4. if "%2" == "" goto Usage
  5. for /f "tokens=*" %%i in (%3) do set _description=%%i
  6. if "%_description%"=="" set /p _description="Description for Change List: "
  7. if "%_description%"=="" goto :eof
  8. if "%1" == "PUBLIC" (
  9. echo Requesting new public changenum for Root depot - please wait
  10. ) ELSE (
  11. echo Requesting new public changenum for %1 depot - please wait
  12. )
  13. del %TEMP%\_sdchngi.tmp >nul 2>nul
  14. del %TEMP%\_sdchngo.tmp >nul 2>nul
  15. pushd %_NTDRIVE%%_NTROOT%\%1
  16. sd change -o > %TEMP%\_sdchngo.tmp
  17. if %errorlevel% GEQ 1 (
  18. echo SD server for %CD% is not available - unable to get a change list
  19. popd
  20. goto :eof
  21. )
  22. for /f "delims=* tokens=* eol=#" %%i in (%TEMP%\_sdchngo.tmp) do (
  23. if "%%i"=="Files:" goto done
  24. if "%%i"==" <enter description here>" (
  25. echo %_description% >>%TEMP%\_sdchngi.tmp
  26. ) else (
  27. echo %%i>>%TEMP%\_sdchngi.tmp
  28. )
  29. )
  30. :done
  31. @rem Make sure this change list starts out empty.
  32. echo Files: >> %TEMP%\_sdchngi.tmp
  33. sd change -i <%TEMP%\_sdchngi.tmp > %_NTDRIVE%%_NTROOT%\public\%2
  34. popd
  35. echo changenum retrieved
  36. del %TEMP%\_sdchngi.tmp >nul 2>nul
  37. del %TEMP%\_sdchngo.tmp >nul 2>nul
  38. goto :eof
  39. :Usage
  40. echo Usage: get_change_num ^<dir^> ^<filename^> ^<description string^>
  41. echo ^<dir^> is the directory containing the root of the project
  42. echo change number is needed for. May be "."
  43. echo ^<filename^> is where the sd change output will be written
  44. echo ^<description string^> is optional (script will prompt if not entered)