##// END OF EJS Templates
py3: fix type of regex literals in patch.py
Yuya Nishihara -
r34068:871a58b5 default
parent child Browse files
Show More
@@ -205,10 +205,11 b' def extract(ui, fileobj):'
205 205
206 206 # attempt to detect the start of a patch
207 207 # (this heuristic is borrowed from quilt)
208 diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |'
209 r'retrieving revision [0-9]+(\.[0-9]+)*$|'
210 r'---[ \t].*?^\+\+\+[ \t]|'
211 r'\*\*\*[ \t].*?^---[ \t])', re.MULTILINE|re.DOTALL)
208 diffre = re.compile(br'^(?:Index:[ \t]|diff[ \t]|RCS file: |'
209 br'retrieving revision [0-9]+(\.[0-9]+)*$|'
210 br'---[ \t].*?^\+\+\+[ \t]|'
211 br'\*\*\*[ \t].*?^---[ \t])',
212 re.MULTILINE | re.DOTALL)
212 213
213 214 data = {}
214 215 fd, tmpname = tempfile.mkstemp(prefix='hg-patch-')
@@ -230,7 +231,7 b' def extract(ui, fileobj):'
230 231 pend = subject.find(']')
231 232 if pend >= 0:
232 233 subject = subject[pend + 1:].lstrip()
233 subject = re.sub(r'\n[ \t]+', ' ', subject)
234 subject = re.sub(br'\n[ \t]+', ' ', subject)
234 235 ui.debug('Subject: %s\n' % subject)
235 236 if data['user']:
236 237 ui.debug('From: %s\n' % data['user'])
@@ -1760,7 +1761,7 b' def scanpatch(fp):'
1760 1761 - ('hunk', [hunk_lines])
1761 1762 - ('range', (-start,len, +start,len, proc))
1762 1763 """
1763 lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
1764 lines_re = re.compile(br'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
1764 1765 lr = linereader(fp)
1765 1766
1766 1767 def scanwhile(first, p):
General Comments 0
You need to be logged in to leave comments. Login now