[plugin] 'version-info' prints out summary information for a branch
John Arbash Meinel
john at arbash-meinel.com
Thu Dec 29 00:52:23 GMT 2005
Hello everyone-
As you have seen, I was looking adding a feature to bzr to generate the
version information as part of the setup.py step. However, in doing so,
I realized that it is really something that I want for lots of projects
that I work on.
So I created a plugin, which can be found at:
http://bzr.arbash-meinel.com/plugins/version_info/
This adds a new command 'bzr version-info' which can generate either rio
style information, or python text which contains a dictionary of
information.
With this plugin, instead of multiple calls to 'bzr' to get appropriate
information during build time, you can just do:
bzr version-info --format=python > project_version.py
It also has flags for:
--check-clean See if there are uncommitted changes
--include-history Include the complete revision-history, along
with commit message.
--check-clean can be expensive if the project is large, so I default to
having it off. This lets you auto-generate the version file every build,
but only when you do a full release does it do the expensive operation
of making sure there are no uncommitted changes.
--include-history is more for small projects which may not have
thousands of commits. That way at run time you can get a short bit of
information about what things have changed. I suppose we could give a
revision range, so that automatic generation could generate the last X
revision messages, or something.
Anyway, long term I would like to see something like this in bzr
mainline. Especially since then bzr could use it in its own 'setup.py'
so that we would have more of information about our current state
available when installed.
I wrote it as a plugin simply because the functionality is important to
me on some of my projects, and I prefer to run a stock bzr.dev + plugins
rather than running a customized bzr.
Also, it should be possible to add new formats, so people with other
programming languages could add a '--format=java' or 'c' or 'c++'.
I mostly went for rio because it is a format which is designed to be
easy to parse for other people so it seemed like a good default. And
then I did a python version because bzr is written in python.
Any comments? Do people prefer a different name than 'version-info'. I'm
certainly not stuck on it, it was just the best I could think of.
John
=:->
PS> It even comes with a bunch of tests. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051228/8644dc62/attachment.pgp
More information about the bazaar
mailing list