comparison mercurial/obsutil.py @ 52722:0cf5f9312b33

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 01 Feb 2025 13:47:56 +0100
parents 5cc8deb96b48
children
comparison
equal deleted inserted replaced
52721:f071b18e1382 52722:0cf5f9312b33
415 def _cmpdiff(leftctx, rightctx): 415 def _cmpdiff(leftctx, rightctx):
416 """return True if both ctx introduce the "same diff" 416 """return True if both ctx introduce the "same diff"
417 417
418 This is a first and basic implementation, with many shortcoming. 418 This is a first and basic implementation, with many shortcoming.
419 """ 419 """
420 diffopts = diffutil.diffallopts(leftctx.repo().ui, {b'git': True}) 420 diffopts = diffutil.diffallopts(
421 leftctx.repo().ui,
422 {b'git': True, b'unified': 1},
423 )
421 424
422 # Leftctx or right ctx might be filtered, so we need to use the contexts 425 # Leftctx or right ctx might be filtered, so we need to use the contexts
423 # with an unfiltered repository to safely compute the diff 426 # with an unfiltered repository to safely compute the diff
424 427
425 # leftctx and rightctx can be from different repository views in case of 428 # leftctx and rightctx can be from different repository views in case of