[MERGE][Trivial] invalid version tuple attempt to raise AssertionError fails with TypeError
Mark Hammond
mhammond at skippinet.com.au
Tue Sep 23 09:13:25 BST 2008
> > Mark Hammond wrote:
> >> This is fairly trivial, but bzrlib._format_version_tuple() raises an
> >> unintended exception when passed an invalid version tuple (so I'm
> reusing
> >> that function even though it has an underscore - sue me ;)
> >
> > Since you admit that you're using a private function in an extension,
> > you should propose turning it into a public function.
>
> I'm happy to rename it to be public if you want to.
That would probably be nice, especially if plugins or extensions to bzr
choose to adopt a similar version numbering scheme - which seems to make
sense. On the other hand, QBzr uses a similarly formatted tuple, but
formats it differently:
version_info = (0, 9, 5, 'dev', 0)
__version__ = '.'.join(map(str, version_info))
and a quick grep of bzr-svn and bzrtools show they don't use it. So I'm
really not sure how widespread usage of _format_version_tuple() is.
On the other hand, a simple grep shows bzr-svn using:
from bzrlib.plugins.svn.transport import _url_escape_uri
from bzrlib.plugins.svn.commit import _revision_id_to_svk_feature
bzrtools:
from bzrlib import revision as _mod_revision
from bzrlib.diff import _patch_header_date (in a test)
QBzr:
from bzrlib.annotate import _annotate_file
from bzrlib.diff import _get_trees_to_diff
bzrlib.builtins.cmd_merge._do_preview(self, merger)
So it looks like there are a few such candidates. Maybe we should just
pretend we never had this conversation :)
Cheers,
Mark
More information about the bazaar
mailing list