I agree that the implementation of the support for pre-tested commit will have to be laid on each individual plugin. The point that I was advocating in Paris was, that there ought to be a recommended approach that the SCM plugin developers should/could use when implementing it.
Our rationale is that all pre-test commits - regardless of the underlying VCS - has a generic character:
(The pre-build step is where the SCM extension currently has it's foot print)
- Establish a workspace representing the tip of the branch
- Merge 'something' into the workspace (the 'something' can be a patch, a pull, a merge from another branch ... - this is up to the SCM plugin developer to decide)
The build step
If the merge succeeded the job continues to the build step - the user simply implement the test that should qualify the commit - typically something relatively simple like build and run the unit test - but the actual test is of course up to the user of the plugin to decide.
The post-build step
The pre-tested commit feature will have to have a foot print in the post-build step to decide if the current state of the workspace is accepted as a new commit - or not)
- If build is successful accept the merge as a new commit, if not then reject it an roll back the workspace (exactly what is going to happen her is up to the developer of the SCM plugin to decide)
Currently the "generic" approach is implemented by having the SCM plugins that supports that pre-tested commit feature extend both SCM and the Notifier (to get a foot print in the post build step).
We suggest that the the SCM extension simply is enhanced so that it has a wrap-up method that is called in the post-build step - those SCM plugins that want to make decisions regarding the workspace could implement and override the wrap-up method - those who doesn't could simply do nothing - and everything would stay the same.
This approach would be backwards compatible and those SCM plugins that want to implement support for pre-tested commits wouldn't have to use the, not so obvious and kind of tedious, approach to have their SCM plugin extend the Notifier as well.