Code review comment for lp:~jkakar/bzr/custom-project-name

Revision history for this message
Martin Pool (mbp) wrote :

Thinking about this a bit more:

There are other parts of bzrlib, like the UIFactory, test runner or
the apport integration, that could potentially be reused in other
places and that may need to report the program name and version
number. The user-agent string sent by transports is another case.

Therefore I think bzr globally needs a concept of "what program is
using me, and what is its version?" It just so happens that this is
normally the script called bzr from the same tree as bzrlib, but
that's only the default.

This should be global to bzrlib. Arguably it should be global to the
Python interpreter instance, but I can't think of a good or standard
place to put it.

So perhaps the most appropriate thing is to just have
bzrlib.application_name and application_version and/or
application_version_tuple. They can be initialized to 'bzr' and the
same as the library version, but could be overridden after importing.
(Even the bzr script could do this...)

--
Martin <http://launchpad.net/~mbp/>

« Back to merge proposal