Jump to content
Michael Buchoff

Fully cleaning a changeset

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Wow, thanks for the fast response!

When I tried cm unco --allit 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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...