Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dispatch.py @ 17228:d1b49b02bc16 stable
dispatch: fix traceback when extension was tested with newer versions only
The "worst" extension still is the one tested with the lowest tested version
below the current version of Mercurial, but if an extension with was only
tested with newer versions, it is considered a candidate for a bad extension,
too. In this case extensions which have been tested with higher versions of
Mercurial are considered better. This allows finding the oldest extension if
ct can't be calculated correctly and therefore defaults to an empty tuple, and
it involves less changes to the comparison logic during the current code
freeze.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 19 Jul 2012 21:20:56 +0200 |
parents | 30143c3dd102 |
children | e51d4aedace9 |
line wrap: on
line diff
--- a/mercurial/dispatch.py Thu Jul 19 16:50:52 2012 +0200 +++ b/mercurial/dispatch.py Thu Jul 19 21:20:56 2012 +0200 @@ -225,8 +225,9 @@ break if compare not in testedwith.split() and testedwith != 'internal': tested = [tuplever(v) for v in testedwith.split()] - nearest = max([t for t in tested if t < ct]) - if nearest < worst[1]: + lower = [t for t in tested if t < ct] + nearest = max(lower or tested) + if worst[0] is None or nearest < worst[1]: worst = name, nearest, report if worst[0] is not None: name, testedwith, report = worst