##// END OF EJS Templates
py3: use bytes.startswith() instead of comparing with bytes[0]...
Pulkit Goyal -
r41772:7c4e205f default
parent child Browse files
Show More
@@ -89,6 +89,7 b' test-clonebundles.t'
89 89 test-close-head.t
90 90 test-commandserver.t
91 91 test-commit-amend.t
92 test-commit-interactive-curses.t
92 93 test-commit-interactive.t
93 94 test-commit-multiple.t
94 95 test-commit-unresolved.t
@@ -377,9 +377,9 b' class uihunk(patchnode):'
377 377 def countchanges(self):
378 378 """changedlines -> (n+,n-)"""
379 379 add = len([l for l in self.changedlines if l.applied
380 and l.prettystr()[0] == '+'])
380 and l.prettystr().startswith('+')])
381 381 rem = len([l for l in self.changedlines if l.applied
382 and l.prettystr()[0] == '-'])
382 and l.prettystr().startswith('-')])
383 383 return add, rem
384 384
385 385 def getfromtoline(self):
@@ -423,7 +423,7 b' class uihunk(patchnode):'
423 423 changedlinestr = changedline.prettystr()
424 424 if changedline.applied:
425 425 hunklinelist.append(changedlinestr)
426 elif changedlinestr[0] == "-":
426 elif changedlinestr.startswith("-"):
427 427 hunklinelist.append(" " + changedlinestr[1:])
428 428
429 429 fp.write(''.join(self.before + hunklinelist + self.after))
@@ -471,11 +471,11 b' class uihunk(patchnode):'
471 471 for line in self.changedlines:
472 472 text = line.linetext
473 473 if line.applied:
474 if text[0] == '+':
474 if text.startswith('+'):
475 475 dels.append(text[1:])
476 elif text[0] == '-':
476 elif text.startswith('-'):
477 477 adds.append(text[1:])
478 elif text[0] == '+':
478 elif text.startswith('+'):
479 479 dels.append(text[1:])
480 480 adds.append(text[1:])
481 481 hunk = ['-%s' % l for l in dels] + ['+%s' % l for l in adds]
General Comments 0
You need to be logged in to leave comments. Login now