I've previously shown how easy it is to add & remove with Ruby. Update and commit can be executed in Ruby by `svn up` and `svn commit*` respectively.
All of these commands could be written into a rake build file as tasks. Each task would have pre-requisite tasks and execution will stop if any pre-requisite task fails. Rake supports this with it's dependency model. Expressing dependency in rake is easy.
task TaskName => [:pre-req1, :pre-req2, ...]
Therefore, the dependencies in our build file would look something like this:
task commit => [:test, :update]
task test => [:compile]
task update => [:add, :remove]
Compile, add & remove don't have any dependencies in our example, and are not shown.
The dependency model ensures a commit will not be executed unless all the pre-requisite tasks had been executed. Developers would be abstracted from this and could commit their changes by simply executing "rake commit" from the command line.
* Be sure to set the EDITOR environment variable. When the EDITOR variable is set any commit (without a message or file specified) will cause an editor window to open for you to enter a commit message.
Hah! Talk about co-incidence - I'd just made a similar comment on the XP mailing list:
ReplyDeletehttp://groups.yahoo.com/group/extremeprogramming/message/111887