Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
17227:7af38fe1f829 | 17228:d1b49b02bc16 |
---|---|
223 # We found an untested extension. It's likely the culprit. | 223 # We found an untested extension. It's likely the culprit. |
224 worst = name, testedwith, report | 224 worst = name, testedwith, report |
225 break | 225 break |
226 if compare not in testedwith.split() and testedwith != 'internal': | 226 if compare not in testedwith.split() and testedwith != 'internal': |
227 tested = [tuplever(v) for v in testedwith.split()] | 227 tested = [tuplever(v) for v in testedwith.split()] |
228 nearest = max([t for t in tested if t < ct]) | 228 lower = [t for t in tested if t < ct] |
229 if nearest < worst[1]: | 229 nearest = max(lower or tested) |
230 if worst[0] is None or nearest < worst[1]: | |
230 worst = name, nearest, report | 231 worst = name, nearest, report |
231 if worst[0] is not None: | 232 if worst[0] is not None: |
232 name, testedwith, report = worst | 233 name, testedwith, report = worst |
233 if not isinstance(testedwith, str): | 234 if not isinstance(testedwith, str): |
234 testedwith = '.'.join([str(c) for c in testedwith]) | 235 testedwith = '.'.join([str(c) for c in testedwith]) |