##// 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 # attempt to detect the start of a patch
206 # attempt to detect the start of a patch
207 # (this heuristic is borrowed from quilt)
207 # (this heuristic is borrowed from quilt)
208 diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |'
208 diffre = re.compile(br'^(?:Index:[ \t]|diff[ \t]|RCS file: |'
209 r'retrieving revision [0-9]+(\.[0-9]+)*$|'
209 br'retrieving revision [0-9]+(\.[0-9]+)*$|'
210 r'---[ \t].*?^\+\+\+[ \t]|'
210 br'---[ \t].*?^\+\+\+[ \t]|'
211 r'\*\*\*[ \t].*?^---[ \t])', re.MULTILINE|re.DOTALL)
211 br'\*\*\*[ \t].*?^---[ \t])',
212 re.MULTILINE | re.DOTALL)
212
213
213 data = {}
214 data = {}
214 fd, tmpname = tempfile.mkstemp(prefix='hg-patch-')
215 fd, tmpname = tempfile.mkstemp(prefix='hg-patch-')
@@ -230,7 +231,7 b' def extract(ui, fileobj):'
230 pend = subject.find(']')
231 pend = subject.find(']')
231 if pend >= 0:
232 if pend >= 0:
232 subject = subject[pend + 1:].lstrip()
233 subject = subject[pend + 1:].lstrip()
233 subject = re.sub(r'\n[ \t]+', ' ', subject)
234 subject = re.sub(br'\n[ \t]+', ' ', subject)
234 ui.debug('Subject: %s\n' % subject)
235 ui.debug('Subject: %s\n' % subject)
235 if data['user']:
236 if data['user']:
236 ui.debug('From: %s\n' % data['user'])
237 ui.debug('From: %s\n' % data['user'])
@@ -1760,7 +1761,7 b' def scanpatch(fp):'
1760 - ('hunk', [hunk_lines])
1761 - ('hunk', [hunk_lines])
1761 - ('range', (-start,len, +start,len, proc))
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 lr = linereader(fp)
1765 lr = linereader(fp)
1765
1766
1766 def scanwhile(first, p):
1767 def scanwhile(first, p):
General Comments 0
You need to be logged in to leave comments. Login now