Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Find all files and filter for those that are unknown by Perforce
- find . -type f | p4 -x - fstat 2>&1 > /dev/null | sed 's/ -.*$//' > /tmp/list
- ### manually check /tmp/list for files you didn't mean to delete
- # Go ahead and remove the unwanted files.
- xargs rm < /tmp/list
- p4 sync "//depot/someFolder/...#0"
- erase C:projectssomeFolder*.* /s /q /f
- rd C:projectssomeFolder /s /q
- p4 sync -f "//depot/someFolder/..."
- find . -type f | p4 -x- have 2>&1 >/dev/null | grep "not on client" | cut -d " " -f1 | xargs -ifoo echo rm foo
- @ECHO OFF
- SETLOCAL EnableDelayedExpansion
- IF "%1"=="" (
- SET proceed=N
- ECHO Are you sure you wish to nuke all files under:
- ECHO %CD%
- SET /P proceed="Y/N: "
- ECHO !proceed!
- IF /I "!proceed!"=="Y" (
- ECHO Nuking %cd%
- FOR /F "tokens=1 delims=-#" %%G IN ('p4 reconcile -nlad -f ...') do (
- DEL /F "%%G"
- )
- )
- ) ELSE IF /I "%1"=="-n" (
- ECHO Files to be deleted 1>&2
- FOR /F "tokens=1 delims=-#" %%G IN ('p4 reconcile -nlad -f ...') do (
- ECHO "%%G"
- )
- ) ELSE GOTO :USAGE
- GOTO :STOP
- :USAGE
- ECHO Usage: nuke [-n]
- ECHO -n will only write the files to be deleted but will not actually delete them
- :STOP
- @ECHO OFF
- SETLOCAL EnableDelayedExpansion
- IF "%1"=="" (
- SET proceed=N
- ECHO Are you sure you wish to nuke all files under:
- ECHO %CD%
- SET /P proceed="Y/N: "
- ECHO Looking for files to be deleted. This may take some time depending on the depth of your tree. 1>&2
- IF /I "!proceed!"=="Y" (
- ECHO Nuking %cd%
- FOR /F "tokens=1 delims=#" %%G IN ('p4 reconcile -nla -f ...') DO (
- DEL /F %%G
- )
- )
- ) ELSE IF /I "%1"=="-n" (
- ECHO Looking for files to be deleted. This may take some time depending on the depth of your tree. 1>&2
- ECHO Files to be deleted 1>&2
- FOR /F "tokens=1 delims=#" %%G IN ('p4 reconcile -nla -f ...') DO (
- ECHO %%G
- )
- ) ELSE GOTO :USAGE
- GOTO :STOP
- :USAGE
- ECHO Usage: nuke [-n]
- ECHO -n will only write the files to be deleted but will not actually delete them
- :STOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement