mercurial/mdiff.py
changeset 51932 d94e21b5b693
parent 51863 f4733654f144
child 51933 f2832de2a46c
equal deleted inserted replaced
51931:2d51b0cf707c 51932:d94e21b5b693
   103 defaultopts = diffopts()
   103 defaultopts = diffopts()
   104 
   104 
   105 
   105 
   106 def wsclean(opts, text, blank=True):
   106 def wsclean(opts, text, blank=True):
   107     if opts.ignorews:
   107     if opts.ignorews:
   108         text = bdiff.fixws(text, 1)
   108         text = bdiff.fixws(text, True)
   109     elif opts.ignorewsamount:
   109     elif opts.ignorewsamount:
   110         text = bdiff.fixws(text, 0)
   110         text = bdiff.fixws(text, False)
   111     if blank and opts.ignoreblanklines:
   111     if blank and opts.ignoreblanklines:
   112         text = re.sub(b'\n+', b'\n', text).strip(b'\n')
   112         text = re.sub(b'\n+', b'\n', text).strip(b'\n')
   113     if opts.ignorewseol:
   113     if opts.ignorewseol:
   114         text = re.sub(br'[ \t\r\f]+\n', br'\n', text)
   114         text = re.sub(br'[ \t\r\f]+\n', br'\n', text)
   115     return text
   115     return text