change-detection: reduce the amount of context used when comparing diff
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 01 Feb 2025 13:47:56 +0100
changeset 52722 0cf5f9312b33
parent 52721 f071b18e1382
child 52723 a502f3f389b5
change-detection: reduce the amount of context used when comparing diff Including more context yield more false positive when detecting patch modification. The impact of this change is mostly seen in evolve's tests.
mercurial/obsutil.py
--- a/mercurial/obsutil.py	Sat Feb 01 13:04:32 2025 +0100
+++ b/mercurial/obsutil.py	Sat Feb 01 13:47:56 2025 +0100
@@ -417,7 +417,10 @@
 
     This is a first and basic implementation, with many shortcoming.
     """
-    diffopts = diffutil.diffallopts(leftctx.repo().ui, {b'git': True})
+    diffopts = diffutil.diffallopts(
+        leftctx.repo().ui,
+        {b'git': True, b'unified': 1},
+    )
 
     # Leftctx or right ctx might be filtered, so we need to use the contexts
     # with an unfiltered repository to safely compute the diff