Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. # Find all files and filter for those that are unknown by Perforce
  2. find . -type f | p4 -x - fstat 2>&1 > /dev/null | sed 's/ -.*$//' > /tmp/list
  3. ### manually check /tmp/list for files you didn't mean to delete
  4. # Go ahead and remove the unwanted files.
  5. xargs rm < /tmp/list
  6.  
  7. p4 sync "//depot/someFolder/...#0"
  8. erase C:projectssomeFolder*.* /s /q /f
  9. rd C:projectssomeFolder /s /q
  10. p4 sync -f "//depot/someFolder/..."
  11.  
  12. find . -type f | p4 -x- have 2>&1 >/dev/null | grep "not on client" | cut -d " " -f1 | xargs -ifoo echo rm foo
  13.  
  14. @ECHO OFF
  15. SETLOCAL EnableDelayedExpansion
  16. IF "%1"=="" (
  17. SET proceed=N
  18. ECHO Are you sure you wish to nuke all files under:
  19. ECHO %CD%
  20. SET /P proceed="Y/N: "
  21. ECHO !proceed!
  22. IF /I "!proceed!"=="Y" (
  23. ECHO Nuking %cd%
  24. FOR /F "tokens=1 delims=-#" %%G IN ('p4 reconcile -nlad -f ...') do (
  25. DEL /F "%%G"
  26. )
  27. )
  28. ) ELSE IF /I "%1"=="-n" (
  29. ECHO Files to be deleted 1>&2
  30. FOR /F "tokens=1 delims=-#" %%G IN ('p4 reconcile -nlad -f ...') do (
  31. ECHO "%%G"
  32. )
  33. ) ELSE GOTO :USAGE
  34.  
  35. GOTO :STOP
  36.  
  37. :USAGE
  38. ECHO Usage: nuke [-n]
  39. ECHO -n will only write the files to be deleted but will not actually delete them
  40.  
  41. :STOP
  42.  
  43. @ECHO OFF
  44. SETLOCAL EnableDelayedExpansion
  45. IF "%1"=="" (
  46. SET proceed=N
  47. ECHO Are you sure you wish to nuke all files under:
  48. ECHO %CD%
  49. SET /P proceed="Y/N: "
  50. ECHO Looking for files to be deleted. This may take some time depending on the depth of your tree. 1>&2
  51. IF /I "!proceed!"=="Y" (
  52. ECHO Nuking %cd%
  53. FOR /F "tokens=1 delims=#" %%G IN ('p4 reconcile -nla -f ...') DO (
  54. DEL /F %%G
  55. )
  56. )
  57. ) ELSE IF /I "%1"=="-n" (
  58. ECHO Looking for files to be deleted. This may take some time depending on the depth of your tree. 1>&2
  59. ECHO Files to be deleted 1>&2
  60. FOR /F "tokens=1 delims=#" %%G IN ('p4 reconcile -nla -f ...') DO (
  61. ECHO %%G
  62. )
  63. ) ELSE GOTO :USAGE
  64.  
  65. GOTO :STOP
  66.  
  67. :USAGE
  68. ECHO Usage: nuke [-n]
  69. ECHO -n will only write the files to be deleted but will not actually delete them
  70.  
  71. :STOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement