##// END OF EJS Templates
py3: stop using bytes[n] in patch.py
Yuya Nishihara -
r34253:c43d055a default
parent child Browse files
Show More
@@ -960,8 +960,8 b' class recordhunk(object):'
960
960
961 def countchanges(self, hunk):
961 def countchanges(self, hunk):
962 """hunk -> (n+,n-)"""
962 """hunk -> (n+,n-)"""
963 add = len([h for h in hunk if h[0] == '+'])
963 add = len([h for h in hunk if h.startswith('+')])
964 rem = len([h for h in hunk if h[0] == '-'])
964 rem = len([h for h in hunk if h.startswith('-')])
965 return add, rem
965 return add, rem
966
966
967 def reversehunk(self):
967 def reversehunk(self):
@@ -972,7 +972,7 b' class recordhunk(object):'
972 unchanged.
972 unchanged.
973 """
973 """
974 m = {'+': '-', '-': '+', '\\': '\\'}
974 m = {'+': '-', '-': '+', '\\': '\\'}
975 hunk = ['%s%s' % (m[l[0]], l[1:]) for l in self.hunk]
975 hunk = ['%s%s' % (m[l[0:1]], l[1:]) for l in self.hunk]
976 return recordhunk(self.header, self.toline, self.fromline, self.proc,
976 return recordhunk(self.header, self.toline, self.fromline, self.proc,
977 self.before, hunk, self.after)
977 self.before, hunk, self.after)
978
978
General Comments 0
You need to be logged in to leave comments. Login now