[ANN] bzr-file-info.py: get info about file version

Alexander Belchenko bialix at ukr.net
Sat May 10 17:52:12 BST 2008

Get version info for a file from Bazaar VCS

bzr-file-info.py is a simple script that helps to obtain info
about last changes in a file.


     python bzr-file-info.py FILENAME

The script will produce output like this:

     #NN YYYY/MM/DD {rev-id}


     * NN - revision number of last modification of file;
     * YYYY/MM/DD - timestamp of last modification of file;
     * rev-id - revision id of last modification of file;

If file info is not available then script will emit '-'.

Using with Doxygen
This script was designed to use it with doxygen.
You should specify name of the script as FILE_VERSION_FILTER parameter
in your Doxyfile, e.g.

    FILE_VERSION_FILTER = bzr-file-info.py

With this parameter doxygen will try to obtain version info for each
processed file.

Notes for Windows users
1) To enable execution of python scripts you need to have Python interpreter
    installed and you should ensure that your environment variable PATHEXT
    listed .PY extension in it.

2) If you're using standalone bzr.exe you should use Python 2.5 as default
    interpreter on your system, or you should install appropriate version
    of bzr suitable for your default Python interpreter.

3) You need to place bzr-file-info.py either to your working tree or
    any suitable directory listed in your PATH environment variable.

Notes for Unix/Linux users
If you put the script to your working tree you'll need to change Doxyfile
settings as:

    FILE_VERSION_FILTER = ./bzr-file-info.py

But this settings will not work on Windows.

Cached version
bzr-file-info-w-cache.py is another version that used special cache file
to speed up subsequent info calculation for big trees with long history.
This script will store calculated info to file .bzr-file-info.cache
in current directory.

Get the code
Project hosted at Launchpad: https://launchpad.net/bzr-file-info

To get the code:
bzr branch http://bazaar.launchpad.net/~bialix/bzr-file-info/trunk

More information about the bazaar-announce mailing list