mercurial/mdiff.py
changeset 12751 8eb758ea738c
parent 12025 2315a95ee887
child 15141 16dc9a32ca04
equal deleted inserted replaced
12750:05bd2658bbb3 12751:8eb758ea738c
    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):