[MERGE][#321066] "bzr log -r 1.1.1..1" dotted revnos in the wrong order raises ValueError
John Arbash Meinel
john at arbash-meinel.com
Mon Jan 26 22:56:24 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Marius Kruger wrote:
> 2009/1/26 John Arbash Meinel <john at arbash-meinel.com
> <mailto:john at arbash-meinel.com>>
>
> I think we should trap this at a different point. Specifically, doing
> "is_ancestor()" is a very expensive check, without much of a benefit.
> Instead, I think we should just trap the location that is causing a
> ValueError and give a better exception at that time.
>
> done.
>
> Originally I was initially VERY tempted to do just that, but I thought
> it was less correct
> and that I can't give the error message I wanted at that point.
> Although I now give a different message than the non-dotted revno case,
> I think it is accurate to the method it happens in and still useful to
> the user.
>
> thanks for looking at this very low priority bug
> marius
>
+ self.assertTrue('revno: %s\n' % revno not in log,
+ 'Contains unexpected revno %s' % revno)
^- I would find this easier to read as:
self.assertFalse(('revno: %s\n' % revno) in log)
The extra parenthesis make it clear that it isn't
'revno: %s\n' % (revno not in log)
Also, I think "assertFalse((x in y))" is a tiny bit clearer than
"assertTrue((x not in y))" but that is certainly a personal taste thing,
and you can do it however you like.
Otherwise I think it looks good.
BB:tweak
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkl+P5gACgkQJdeBCYSNAAPITgCgxVF/iyN5eIvtBQC62gsOdeg+
P5EAoMbBpY3OgvmipoeW13rq9RN1sGi7
=DrKn
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list