svn-clean.cmd без затей

Published by @newtover on 2017-04-05

From http://tarelkin.livejournal.com/5868.html

Jan. 18th, 2007 12:04 pm

@echo off
setlocal ENABLEDELAYEDEXPANSION

set files_to_delete=

for /f “tokens=* usebackq” %%A in (svn status) do (
set qwe=%%A
if “!qwe:~0,1!” equ “?” (
set files_to_delete=!files_to_delete! “!qwe:~7!”
)
)

for %%A in (%files_to_delete%) do (
if exist %%A (
if exist %%~A\nul (
rd /s /q %%A
echo %%A is removed.
) else (
del /f %%A
echo %%A is removed.
)
)
)

endlocal

Tags: cmd, svn


2015-2017 Mokum.place