# HG changeset patch # User Augie Fackler # Date 2019-10-30 20:29:45 # Node ID 14e3be17e5f5b2bbc3f86da8fbafd4a1727c72da # Parent cb0d80831ee006dd4de4ee5aa3500cee3571dcdd hghave: verify we have a black that is new enough for our format We require what is currently the absolute latest black, so let's be paranoid. diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -1,5 +1,6 @@ from __future__ import absolute_import, print_function +import distutils.version import os import re import socket @@ -982,7 +983,8 @@ def has_emacs(): @check('black', 'the black formatter for python') def has_black(): - # use that to actual black as soon as possible blackcmd = 'black --version' - version_regex = b'black, version \d' - return matchoutput(blackcmd, version_regex) + version_regex = b'black, version ([0-9a-b.]+)' + version = matchoutput(blackcmd, version_regex) + sv = distutils.version.StrictVersion + return version and sv(version.group(1)) >= sv('19.10b0')