mercurial/pure/bdiff.py
changeset 31641 f2b334e6c7e0
parent 31640 6d30699729dd
child 32369 3b88a7fa97d8
equal deleted inserted replaced
31640:6d30699729dd 31641:f2b334e6c7e0
    52         r.append((a1, b1, l1 + shift))
    52         r.append((a1, b1, l1 + shift))
    53         prev = a2 + shift, b2 + shift, l2 - shift
    53         prev = a2 + shift, b2 + shift, l2 - shift
    54     r.append(prev)
    54     r.append(prev)
    55     return r
    55     return r
    56 
    56 
    57 def _tostring(c):
       
    58     return str(c)
       
    59 
       
    60 def bdiff(a, b):
    57 def bdiff(a, b):
    61     a = _tostring(a).splitlines(True)
    58     a = bytes(a).splitlines(True)
    62     b = _tostring(b).splitlines(True)
    59     b = bytes(b).splitlines(True)
    63 
    60 
    64     if not a:
    61     if not a:
    65         s = "".join(b)
    62         s = "".join(b)
    66         return s and (struct.pack(">lll", 0, 0, len(s)) + s)
    63         return s and (struct.pack(">lll", 0, 0, len(s)) + s)
    67 
    64