diff -r 14983ac4a764 -r bd3f03d8cc9f mercurial/patch.py --- a/mercurial/patch.py Mon Feb 04 09:29:25 2019 -0800 +++ b/mercurial/patch.py Mon Feb 04 08:54:30 2019 -0800 @@ -638,8 +638,8 @@ return self.changed | self.removed # @@ -start,len +start,len @@ or @@ -start +start @@ if len is 1 -unidesc = re.compile('@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@') -contextdesc = re.compile('(?:---|\*\*\*) (\d+)(?:,(\d+))? (?:---|\*\*\*)') +unidesc = re.compile(br'@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@') +contextdesc = re.compile(br'(?:---|\*\*\*) (\d+)(?:,(\d+))? (?:---|\*\*\*)') eolmodes = ['strict', 'crlf', 'lf', 'auto'] class patchfile(object): @@ -2762,7 +2762,7 @@ return maxfile, maxtotal, addtotal, removetotal, binary def diffstatdata(lines): - diffre = re.compile('^diff .*-r [a-z0-9]+\s(.*)$') + diffre = re.compile(br'^diff .*-r [a-z0-9]+\s(.*)$') results = [] filename, adds, removes, isbinary = None, 0, 0, False