rewriteutil: move allowdivergence check to foldcheck()
foldcheck() calls precheck() first and then performs more fold-specific checks.
--HG-- branch : stable
foldcheck() calls precheck() first and then performs more fold-specific checks.
--HG-- branch : stable