Michael Buchoff Posted March 21, 2018 Report Share Posted March 21, 2018 As part of our automated build process, we want to undo all changes and delete all added files (ignored and hidden) before building so that we're starting from a completely clean changeset. We've experimented with various cm.exe options, but haven't found any combination that does what we're trying to do. As a workaround, we typically delete the entire directory (with rmdir /s /q) and check it back out, but occasionally the directory doesn't delete successfully; one of the background processes such as an antivirus or plasticscmshellextensionproxy.exe probably has lock on it. What's the preferred way to completely clean a changeset? Thanks in advance. Link to comment Share on other sites More sharing options...
psantosl Posted March 21, 2018 Report Share Posted March 21, 2018 Hi Michael, Let me know if this helps: https://www.plasticscm.com/documentation/cli/plastic-scm-version-control-cli-guide.shtml#Cleanupallchangesintheworkspace Link to comment Share on other sites More sharing options...
Michael Buchoff Posted March 21, 2018 Author Report Share Posted March 21, 2018 Wow, thanks for the fast response! When I tried cm unco --all, it undid all my changes, but didn't delete all the private, hidden, and ignored files. When typing cm unco --help, the help text doesn't mention the --all switch, so maybe there's a way to ask for this as well? Edit: cm version tells me I'm running 6.0.16.1765. Link to comment Share on other sites More sharing options...
Michael Buchoff Posted April 2, 2018 Author Report Share Posted April 2, 2018 Just wanted to bump here. Does anyone know a way to fully clean a Plastic revision, including unversioned files? Link to comment Share on other sites More sharing options...
manu Posted April 3, 2018 Report Share Posted April 3, 2018 Hi @Michael Buchoff, I'm afraid plastic will never delete your private files but you can search them and get rid of them. For ignored private files you can do the following: @echo off setlocal enableextensions disabledelayedexpansion for /f "delims=" %%a in ('cm status --private --short') do del /q "%%a" Yes, a little tricky since the del command can't be piped (AFIK). You can combine the ignore and private search by using the two flags at once: --ignored --private Hope it helps! Link to comment Share on other sites More sharing options...
Michael Buchoff Posted April 24, 2018 Author Report Share Posted April 24, 2018 So we finally got around to applying the script above and it seems to almost work. There's a delay of a few minutes, followed by a long list of del command deleting the ignored files/directories. Unfortunately, the final del command is: Quote del /q "Finding changed files took too long. Perf tips: https://www.plasticscm.com/download/help/statusperfhintschanged" Apparently, there's a built-in time limit for the cm status command to run. Is there an option to turn that time limit off? Link to comment Share on other sites More sharing options...
manu Posted April 25, 2018 Report Share Posted April 25, 2018 Hello @Michael Buchoff, yes! you can turn it off by running the status command with the "--machinereadable" parameter. cm status --private --short --machinereadable hope it helps! Link to comment Share on other sites More sharing options...
davidoddgames Posted July 5, 2019 Report Share Posted July 5, 2019 This is what i use IFS=$'\n'; for OUTPUT in $(cm status --fp --short --compact); do rm -R "$OUTPUT"; done; Link to comment Share on other sites More sharing options...
gweronimo Posted February 12, 2020 Report Share Posted February 12, 2020 In case it helps anyone, there's a flag --cutignored that can be combined with --ignored to filter out the contents below ignored directories, thereby simplifying the output. The following command gives a list that can be used directly in a FOR loop : cm status --ignored --cutignored --compact --short Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now