diff -r a247a0e82e7d -r 7834927f0243 tests/hghave.py --- a/tests/hghave.py Sat Mar 03 12:39:14 2018 -0800 +++ b/tests/hghave.py Sat Mar 03 12:39:15 2018 -0800 @@ -708,3 +708,12 @@ # libfuzzer is new in clang 6 return int(mat.group(1)) > 5 return False + +@check("xdiff", "xdiff algorithm") +def has_xdiff(): + try: + from mercurial import policy + bdiff = policy.importmod('bdiff') + return bdiff.xdiffblocks('', '') == [(0, 0, 0, 0)] + except (ImportError, AttributeError) as ex: + return False