##// END OF EJS Templates
Clean up mdiff imports
Matt Mackall -
r1379:8ee7ce87 default
parent child Browse files
Show More
@@ -5,16 +5,14 b''
5 # This software may be used and distributed according to the terms
5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7
7
8 import difflib, struct, bdiff
8 import difflib, struct, bdiff, util, mpatch
9 from mpatch import *
10 from util import *
11
9
12 def unidiff(a, ad, b, bd, fn, r=None, text=False):
10 def unidiff(a, ad, b, bd, fn, r=None, text=False):
13
11
14 if not a and not b: return ""
12 if not a and not b: return ""
15 epoch = datestr((0,0))
13 epoch = util.datestr((0, 0))
16
14
17 if not text and (binary(a) or binary(b)):
15 if not text and (util.binary(a) or util.binary(b)):
18 l = ['Binary file %s has changed\n' % fn]
16 l = ['Binary file %s has changed\n' % fn]
19 elif a == None:
17 elif a == None:
20 b = b.splitlines(1)
18 b = b.splitlines(1)
@@ -117,8 +115,9 b' def patchtext(bin):'
117 return "".join(t)
115 return "".join(t)
118
116
119 def patch(a, bin):
117 def patch(a, bin):
120 return patches(a, [bin])
118 return mpatch.patches(a, [bin])
121
119
120 patches = mpatch.patches
122 textdiff = bdiff.bdiff
121 textdiff = bdiff.bdiff
123
122
124
123
General Comments 0
You need to be logged in to leave comments. Login now