##// 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 # We found an untested extension. It's likely the culprit.
283 # We found an untested extension. It's likely the culprit.
284 worst = name, 'unknown', report
284 worst = name, 'unknown', report
285 break
285 break
286 if compare not in testedwith.split() and testedwith != 'internal':
286
287 tested = [tuplever(v) for v in testedwith.split()]
287 # Never blame on extensions bundled with Mercurial.
288 lower = [t for t in tested if t < ct]
288 if testedwith == 'internal':
289 nearest = max(lower or tested)
289 continue
290 if worst[0] is None or nearest < worst[1]:
290
291 worst = name, nearest, report
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 if worst[0] is not None:
299 if worst[0] is not None:
293 name, testedwith, report = worst
300 name, testedwith, report = worst
294 if not isinstance(testedwith, str):
301 if not isinstance(testedwith, str):
@@ -315,7 +322,10 b' def _runcatch(req):'
315
322
316 def tuplever(v):
323 def tuplever(v):
317 try:
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 except ValueError:
329 except ValueError:
320 return tuple()
330 return tuple()
321
331
@@ -858,7 +858,7 b' Broken disabled extension and command:'
858 [255]
858 [255]
859
859
860 $ cat > throw.py <<EOF
860 $ cat > throw.py <<EOF
861 > from mercurial import cmdutil, commands
861 > from mercurial import cmdutil, commands, util
862 > cmdtable = {}
862 > cmdtable = {}
863 > command = cmdutil.command(cmdtable)
863 > command = cmdutil.command(cmdtable)
864 > class Bogon(Exception): pass
864 > class Bogon(Exception): pass
@@ -910,7 +910,7 b' If the extensions declare outdated versi'
910 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
910 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
911 > throw 2>&1 | egrep '^\*\*'
911 > throw 2>&1 | egrep '^\*\*'
912 ** Unknown exception encountered with possibly-broken third-party extension older
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 ** Please disable older and try your action again.
914 ** Please disable older and try your action again.
915 ** If that fixes the bug please report it to the extension author.
915 ** If that fixes the bug please report it to the extension author.
916 ** Python * (glob)
916 ** Python * (glob)
@@ -923,7 +923,7 b' One extension only tested with older, on'
923 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
923 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
924 > throw 2>&1 | egrep '^\*\*'
924 > throw 2>&1 | egrep '^\*\*'
925 ** Unknown exception encountered with possibly-broken third-party extension older
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 ** Please disable older and try your action again.
927 ** Please disable older and try your action again.
928 ** If that fixes the bug please report it to the extension author.
928 ** If that fixes the bug please report it to the extension author.
929 ** Python * (glob)
929 ** Python * (glob)
@@ -936,7 +936,7 b' Older extension is tested with current v'
936 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
936 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
937 > throw 2>&1 | egrep '^\*\*'
937 > throw 2>&1 | egrep '^\*\*'
938 ** Unknown exception encountered with possibly-broken third-party extension throw
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 ** Please disable throw and try your action again.
940 ** Please disable throw and try your action again.
941 ** If that fixes the bug please report it to http://example.com/bts
941 ** If that fixes the bug please report it to http://example.com/bts
942 ** Python * (glob)
942 ** Python * (glob)
@@ -954,6 +954,17 b' Declare the version as supporting this h'
954 ** Mercurial Distributed SCM (*) (glob)
954 ** Mercurial Distributed SCM (*) (glob)
955 ** Extensions loaded: throw
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 Test version number support in 'hg version':
968 Test version number support in 'hg version':
958 $ echo '__version__ = (1, 2, 3)' >> throw.py
969 $ echo '__version__ = (1, 2, 3)' >> throw.py
959 $ rm -f throw.pyc throw.pyo
970 $ rm -f throw.pyc throw.pyo
General Comments 0
You need to be logged in to leave comments. Login now