Mercurial > public > mercurial-scm > hg
comparison mercurial/mdiff.py @ 35584:6f62a1c3e11d
py3: make regular expressions bytes by prepending b''
Regexes start with r'' and hence transformer skips adding b'' there.
# skip-blame because we are just adding b''
Differential Revision: https://phab.mercurial-scm.org/D1794
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 29 Dec 2017 05:28:05 +0530 |
parents | 2f123f309f61 |
children | 079b27b5a869 |
comparison
equal
deleted
inserted
replaced
35583:2f123f309f61 | 35584:6f62a1c3e11d |
---|---|
98 elif opts.ignorewsamount: | 98 elif opts.ignorewsamount: |
99 text = bdiff.fixws(text, 0) | 99 text = bdiff.fixws(text, 0) |
100 if blank and opts.ignoreblanklines: | 100 if blank and opts.ignoreblanklines: |
101 text = re.sub('\n+', '\n', text).strip('\n') | 101 text = re.sub('\n+', '\n', text).strip('\n') |
102 if opts.ignorewseol: | 102 if opts.ignorewseol: |
103 text = re.sub(r'[ \t\r\f]+\n', r'\n', text) | 103 text = re.sub(br'[ \t\r\f]+\n', r'\n', text) |
104 return text | 104 return text |
105 | 105 |
106 def splitblock(base1, lines1, base2, lines2, opts): | 106 def splitblock(base1, lines1, base2, lines2, opts): |
107 # The input lines matches except for interwoven blank lines. We | 107 # The input lines matches except for interwoven blank lines. We |
108 # transform it into a sequence of matching blocks and blank blocks. | 108 # transform it into a sequence of matching blocks and blank blocks. |