##// END OF EJS Templates
dispatch: use versiontuple()...
Gregory Szorc -
r27113:77850d2a default
parent child Browse files
Show More
@@ -320,7 +320,6 b' def _runcatch(req):'
320 except socket.error as inst:
320 except socket.error as inst:
321 ui.warn(_("abort: %s\n") % inst.args[-1])
321 ui.warn(_("abort: %s\n") % inst.args[-1])
322 except: # re-raises
322 except: # re-raises
323 myver = util.version()
324 # For compatibility checking, we discard the portion of the hg
323 # For compatibility checking, we discard the portion of the hg
325 # version after the + on the assumption that if a "normal
324 # version after the + on the assumption that if a "normal
326 # user" is running a build with a + in it the packager
325 # user" is running a build with a + in it the packager
@@ -328,8 +327,7 b' def _runcatch(req):'
328 # 'make local' copy of hg (where the version number can be out
327 # 'make local' copy of hg (where the version number can be out
329 # of date) will be clueful enough to notice the implausible
328 # of date) will be clueful enough to notice the implausible
330 # version number and try updating.
329 # version number and try updating.
331 compare = myver.split('+')[0]
330 ct = util.versiontuple(n=2)
332 ct = tuplever(compare)
333 worst = None, ct, ''
331 worst = None, ct, ''
334 if ui.config('ui', 'supportcontact', None) is None:
332 if ui.config('ui', 'supportcontact', None) is None:
335 for name, mod in extensions.extensions():
333 for name, mod in extensions.extensions():
@@ -344,7 +342,7 b' def _runcatch(req):'
344 if testedwith == 'internal':
342 if testedwith == 'internal':
345 continue
343 continue
346
344
347 tested = [tuplever(t) for t in testedwith.split()]
345 tested = [util.versiontuple(t, 2) for t in testedwith.split()]
348 if ct in tested:
346 if ct in tested:
349 continue
347 continue
350
348
@@ -369,7 +367,8 b' def _runcatch(req):'
369 warning = (_("** unknown exception encountered, "
367 warning = (_("** unknown exception encountered, "
370 "please report by visiting\n** ") + bugtracker + '\n')
368 "please report by visiting\n** ") + bugtracker + '\n')
371 warning += ((_("** Python %s\n") % sys.version.replace('\n', '')) +
369 warning += ((_("** Python %s\n") % sys.version.replace('\n', '')) +
372 (_("** Mercurial Distributed SCM (version %s)\n") % myver) +
370 (_("** Mercurial Distributed SCM (version %s)\n") %
371 util.version()) +
373 (_("** Extensions loaded: %s\n") %
372 (_("** Extensions loaded: %s\n") %
374 ", ".join([x[0] for x in extensions.extensions()])))
373 ", ".join([x[0] for x in extensions.extensions()])))
375 ui.log("commandexception", "%s\n%s\n", warning, traceback.format_exc())
374 ui.log("commandexception", "%s\n%s\n", warning, traceback.format_exc())
@@ -378,15 +377,6 b' def _runcatch(req):'
378
377
379 return -1
378 return -1
380
379
381 def tuplever(v):
382 try:
383 # Assertion: tuplever is only used for extension compatibility
384 # checking. Otherwise, the discarding of extra version fields is
385 # incorrect.
386 return tuple([int(i) for i in v.split('.')[0:2]])
387 except ValueError:
388 return tuple()
389
390 def aliasargs(fn, givenargs):
380 def aliasargs(fn, givenargs):
391 args = getattr(fn, 'args', [])
381 args = getattr(fn, 'args', [])
392 if args:
382 if args:
General Comments 0
You need to be logged in to leave comments. Login now