Type: New Feature
It seems like a "clean pull" option would be a useful general feature for all SCMs. One thing that I've seen done in the past is to do a "clean pull" every Nth build, or every build at a given time, so that would be a nice extension of this.
It's a little tougher to do with Perforce than some other SCMs with its server-side state. Currently the Perforce plugin blocks workspace deletion form the UI. Making that work would also be nice.
So, I think a complete "clean build" feature package might look like:
1. enable manual workspace deletion in the UI
2. add a sticky force-sync option to always pass -f to the sync
3. add a sticky workspace clean option to nuke the workspace before syncing
I think after running #1 or #3, a -f would have to be implicitly added to the next sync. That shouldn't be too hard.
Also consider adding support for the new -p flag:
Perforce 2007.2 introduced "-p" to p4 sync which makes it behave "just like the others". From p4 help sync :
"The -p flag populates the client workspace, but does not update the
server to reflect those updates. Any file that is already synced or
opened will be bypassed with a warning message. This option is very
useful for build clients or when publishing content without the
requirement of saving the client workspace state."