merge: only sort manifests in debug mode (issue3769)

--HG--
branch : stable