DVCS comparison for our organisation: decided
Nicholas Allen
allen at ableton.com
Tue Oct 16 10:26:28 BST 2007
> Thanks for the feedback. FWIW, here's the python script to run a shell
> command:
>
> import os
> os.system('echo "Hello World"')
>
> where 'echo ...' is anything you want. I'll have a look at making that
> even easier so users can specify a shell command line directly in a
> file. It's really very simple though - 2 lines - for cases when a shell
> command line is good enough.
I think Bazaar is doing it the right way by allowing Python hooks. It
just needs to be *very* clear how to run an arbitrary command line in
the documentation as this is a common requirement and not every user of
the software will be a Python programmer. It is much more flexible this
way but I also think that it could also be made easier to run arbitrary
commands through a config file without having to write any Python code.
But I think these hooks are of limited benefit for running test suits
and build commands. I guess it depends on the size of your project but I
like to commit often and expect a commit to be on the order of one
second. Even for small projects a build and test will take longer than
this and this will discourage my commit often workflow. To me these
hooks are only useful for notifying team members of changes that have
been made (e.g. via email) that should take a similar amount of time and
be quick regardless of the size of the project. As for sending email I
think there is an email plugin for Bazaar that makes it even easier than
writing a shell script.
To run build commands and test suits it makes *much* more sense to do
this asynchronously. Ideally you would want this before any branch is
merged to the stable trunk but maybe also as developers commit to their
own public branches. I don't think Mercurial has support for this
(although I think PQM can be used with Mercurial too as it is not VCS
specific).
Trying to use these hooks to run build commands and test suits on every
commit is doomed to failure and is not a good criteria to use when
choosing a VCS in my opinion.
I do agree though that Bazaar could do a lot to improve the documentation...
Nick
More information about the bazaar
mailing list