mercurial/mdiff.py
changeset 4357 99c853a1408c
parent 4107 226df1808f16
child 4679 826659bd8053
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -250,6 +250,10 @@ def patchtext(bin):
 def patch(a, bin):
     return mpatch.patches(a, [bin])
 
+# similar to difflib.SequenceMatcher.get_matching_blocks
+def get_matching_blocks(a, b):
+    return [(d[0], d[2], d[1] - d[0]) for d in bdiff.blocks(a, b)]
+
 patches = mpatch.patches
 patchedsize = mpatch.patchedsize
 textdiff = bdiff.bdiff