Developing in NetBeans with Maven I often keep reverting back to local history and svn code as things no longer work (TDD?). Other than committing to a 'testing new idea X' branch after each successful build/test is there how I could configure Maven to do that at each build automatically?

Is anyone else running into the same issue, and approaching it differently? 

EDIT: so the question is: how can I have an automatic commit each time a maven build is successful such that I may revert to it? Preferably with mercurial.