Post Commit Update

Michael Andronov michael_andronov at sd-kyber.com
Wed Sep 29 04:10:06 BST 2010


As John mentioned, there are 2 ways to access the bzr repository.
In my case, I was not able to control the way people preferred to
access the repositories.
So, I had to assume that people would access the repository directly.

I found the solution by monitoring the .bzr/repository/lock by inotify program.

So, the script is maintained by cron, and the main part of it:
"
...
while /usr/local/bin/inotifywait -e delete  $srcR/.bzr/repository/lock
| grep 'DELETE,ISDIR releasing' &> /dev/null; do
#   the actual work will be done...
su $bzrUser -c "$wrkDir/bzrPostCommit.py $cmdL "
done
...
"
bzrUser -- the user, on which account the bzrPostCommit.sh will run;
cmdL     -- inline parameters, if any;
$wrkDit/bzrPostCommit.py -- the path to & the post Commit script itself...
see 'man inotify' for details on inotify. (OSX has similar service via launchd)

I'm not saying that the above is a perfect solution.
But depending on what your goal is, the above may do the trick for
your project too.

Michael.



More information about the bazaar mailing list