65 |
65 |
66 defaultopts = diffopts() |
66 defaultopts = diffopts() |
67 |
67 |
68 def wsclean(opts, text, blank=True): |
68 def wsclean(opts, text, blank=True): |
69 if opts.ignorews: |
69 if opts.ignorews: |
70 text = re.sub('[ \t]+', '', text) |
70 text = re.sub('[ \t\r]+', '', text) |
71 elif opts.ignorewsamount: |
71 elif opts.ignorewsamount: |
72 text = re.sub('[ \t]+', ' ', text) |
72 text = re.sub('[ \t\r]+', ' ', text) |
73 text = re.sub('[ \t]+\n', '\n', text) |
73 text = text.replace(' \n', '\n') |
74 if blank and opts.ignoreblanklines: |
74 if blank and opts.ignoreblanklines: |
75 text = re.sub('\n+', '', text) |
75 text = re.sub('\n+', '', text) |
76 return text |
76 return text |
77 |
77 |
78 def diffline(revs, a, b, opts): |
78 def diffline(revs, a, b, opts): |