mercurial/mdiff.py
changeset 15530 eeac5e179243
parent 15529 b35cf47286a6
child 15657 d976b1ef6760
equal deleted inserted replaced
15529:b35cf47286a6 15530:eeac5e179243
    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\r]+', '', text)
    70         text = bdiff.fixws(text, 1)
    71     elif opts.ignorewsamount:
    71     elif opts.ignorewsamount:
    72         text = re.sub('[ \t\r]+', ' ', text)
    72         text = bdiff.fixws(text, 0)
    73         text = text.replace(' \n', '\n')
       
    74     if blank and opts.ignoreblanklines:
    73     if blank and opts.ignoreblanklines:
    75         text = re.sub('\n+', '\n', text).strip('\n')
    74         text = re.sub('\n+', '\n', text).strip('\n')
    76     return text
    75     return text
    77 
    76 
    78 def splitblock(base1, lines1, base2, lines2, opts):
    77 def splitblock(base1, lines1, base2, lines2, opts):