comparison mercurial/mdiff.py @ 32200:2d84947cd85d

mdiff: move re-exports to top This style seems more common in our codebase.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 02 May 2017 17:05:22 +0900
parents ca3b4a2b7e54
children 4462a981e8df
comparison
equal deleted inserted replaced
32199:2bf62ca7072f 32200:2d84947cd85d
18 error, 18 error,
19 mpatch, 19 mpatch,
20 pycompat, 20 pycompat,
21 util, 21 util,
22 ) 22 )
23
24 patches = mpatch.patches
25 patchedsize = mpatch.patchedsize
26 textdiff = bdiff.bdiff
23 27
24 def splitnewlines(text): 28 def splitnewlines(text):
25 '''like str.splitlines, but only split on newlines.''' 29 '''like str.splitlines, but only split on newlines.'''
26 lines = [l + '\n' for l in text.split('\n')] 30 lines = [l + '\n' for l in text.split('\n')]
27 if lines: 31 if lines:
476 def trivialdiffheader(length): 480 def trivialdiffheader(length):
477 return struct.pack(">lll", 0, 0, length) if length else '' 481 return struct.pack(">lll", 0, 0, length) if length else ''
478 482
479 def replacediffheader(oldlen, newlen): 483 def replacediffheader(oldlen, newlen):
480 return struct.pack(">lll", 0, oldlen, newlen) 484 return struct.pack(">lll", 0, oldlen, newlen)
481
482 patches = mpatch.patches
483 patchedsize = mpatch.patchedsize
484 textdiff = bdiff.bdiff