scm: How to restore a workspace to "pristine"?
How can a restore a workspace to a "pristine" state? e.g. identical if I just cloned it?
In git, I can do: "git reset .; git checkout .; git clean -xfd" to restore a check out to a pristine state.
How do I do this with the 'scm' command?
Details:
My specific requirements are I'm using the Jenkins plugin and want to ensure the workspace is clean before the next build happens. I am currently just blowing everything away and re-loading the workspace, but this is slow.
One answer
scm undo does not allow undoing a directory that has changes to files (defect 119103). A workaround would be to write a script that runs 'scm status' from the root of the sandbox (Use --json option to get the result in json format). This would return all unresolved files and then run 'scm undo' to remove (in case of additions) or undo (in case of modifications) from the file system.