Parsing Bazaar logs with PHP
Nov 13, 2010 (about 1 year ago)
I have recently been playing around with parsing Bazaar logs in PHP. I have been doing this because I thought that it might be fun to provide a rudimentary way of browsing my project Bazaar logs from my site.
Before starting this exercise, I thought that providing this feature might be somewhat difficult, but as it turned out, it was actually quite simple. Basically, I started by capturing the output of the command: bzr log --line -rN..N /path/to/bzr/repo. I then exploded the captured data into an array using \n as the delimiter. Once I had populated the array, it was then simply a case of manipulating the array values to obtain the revision numbers, before using the captured revision numbers to run more bzr commands.
A working example can be seen for my Whird project. Did I mention it was rudimentary?
Add your comment
Use the form below to add your comment. Markdown syntax is available. Note, all comments are moderated.