Automatically remove Subversion unversioned files

前端 未结 30 3121
感情败类
感情败类 2020-11-28 18:54

Does anybody know a way to recursively remove all files in a working copy that are not under version control? (I need this to get more reliable results in my automatic build

30条回答
  •  暖寄归人
    2020-11-28 19:19

    I used ~3 hours to generate this. It would take 5 mins to do it in Unix. The mains issue were: spaces in names for Win folders, impossibility to edit %%i and problem with defining vars in Win cmd loop.

    setlocal enabledelayedexpansion
    
    for /f "skip=1 tokens=2* delims==" %%i in ('svn status --no-ignore --xml ^| findstr /r "path"') do (
    @set j=%%i
    @rd /s /q !j:~0,-1!
    )
    

提交回复
热议问题