##// END OF EJS Templates
dispatch: only check compatibility against major and minor versions (BC)...
Gregory Szorc -
r23871:b2d8f368 default
parent child Browse files
Show More
@@ -283,12 +283,19 b' def _runcatch(req):'
283 283 # We found an untested extension. It's likely the culprit.
284 284 worst = name, 'unknown', report
285 285 break
286 if compare not in testedwith.split() and testedwith != 'internal':
287 tested = [tuplever(v) for v in testedwith.split()]
288 lower = [t for t in tested if t < ct]
289 nearest = max(lower or tested)
290 if worst[0] is None or nearest < worst[1]:
291 worst = name, nearest, report
286
287 # Never blame on extensions bundled with Mercurial.
288 if testedwith == 'internal':
289 continue
290
291 tested = [tuplever(t) for t in testedwith.split()]
292 if ct in tested:
293 continue
294
295 lower = [t for t in tested if t < ct]
296 nearest = max(lower or tested)
297 if worst[0] is None or nearest < worst[1]:
298 worst = name, nearest, report
292 299 if worst[0] is not None:
293 300 name, testedwith, report = worst
294 301 if not isinstance(testedwith, str):
@@ -315,7 +322,10 b' def _runcatch(req):'
315 322
316 323 def tuplever(v):
317 324 try:
318 return tuple([int(i) for i in v.split('.')])
325 # Assertion: tuplever is only used for extension compatibility
326 # checking. Otherwise, the discarding of extra version fields is
327 # incorrect.
328 return tuple([int(i) for i in v.split('.')[0:2]])
319 329 except ValueError:
320 330 return tuple()
321 331
@@ -858,7 +858,7 b' Broken disabled extension and command:'
858 858 [255]
859 859
860 860 $ cat > throw.py <<EOF
861 > from mercurial import cmdutil, commands
861 > from mercurial import cmdutil, commands, util
862 862 > cmdtable = {}
863 863 > command = cmdutil.command(cmdtable)
864 864 > class Bogon(Exception): pass
@@ -910,7 +910,7 b' If the extensions declare outdated versi'
910 910 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
911 911 > throw 2>&1 | egrep '^\*\*'
912 912 ** Unknown exception encountered with possibly-broken third-party extension older
913 ** which supports versions 1.9.3 of Mercurial.
913 ** which supports versions 1.9 of Mercurial.
914 914 ** Please disable older and try your action again.
915 915 ** If that fixes the bug please report it to the extension author.
916 916 ** Python * (glob)
@@ -923,7 +923,7 b' One extension only tested with older, on'
923 923 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
924 924 > throw 2>&1 | egrep '^\*\*'
925 925 ** Unknown exception encountered with possibly-broken third-party extension older
926 ** which supports versions 1.9.3 of Mercurial.
926 ** which supports versions 1.9 of Mercurial.
927 927 ** Please disable older and try your action again.
928 928 ** If that fixes the bug please report it to the extension author.
929 929 ** Python * (glob)
@@ -936,7 +936,7 b' Older extension is tested with current v'
936 936 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
937 937 > throw 2>&1 | egrep '^\*\*'
938 938 ** Unknown exception encountered with possibly-broken third-party extension throw
939 ** which supports versions 2.1.1 of Mercurial.
939 ** which supports versions 2.1 of Mercurial.
940 940 ** Please disable throw and try your action again.
941 941 ** If that fixes the bug please report it to http://example.com/bts
942 942 ** Python * (glob)
@@ -954,6 +954,17 b' Declare the version as supporting this h'
954 954 ** Mercurial Distributed SCM (*) (glob)
955 955 ** Extensions loaded: throw
956 956
957 Patch version is ignored during compatibility check
958 $ echo "testedwith = '3.2'" >> throw.py
959 $ echo "util.version = lambda:'3.2.2'" >> throw.py
960 $ rm -f throw.pyc throw.pyo
961 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
962 ** unknown exception encountered, please report by visiting
963 ** http://mercurial.selenic.com/wiki/BugTracker
964 ** Python * (glob)
965 ** Mercurial Distributed SCM (*) (glob)
966 ** Extensions loaded: throw
967
957 968 Test version number support in 'hg version':
958 969 $ echo '__version__ = (1, 2, 3)' >> throw.py
959 970 $ rm -f throw.pyc throw.pyo
General Comments 0
You need to be logged in to leave comments. Login now