Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



One answer

Permanent link
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.

0 votes

Comments

Will that take care of jazz ignored files too?  Does such a script already exist? 

No. It will not take care of ignored files. I am not aware of any script that does this work.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,020
× 383

Question asked: Feb 06 '14, 1:56 p.m.

Question was seen: 5,355 times

Last updated: Feb 09 '14, 11:38 p.m.

Confirmation Cancel Confirm