##// END OF EJS Templates
patch: inline patchfile.hashlines()
Patrick Mezard -
r13700:63307feb default
parent child Browse files
Show More
@@ -488,11 +488,6 b' class patchfile(object):'
488 488 cand.sort(key=lambda x: abs(x - linenum))
489 489 return cand
490 490
491 def hashlines(self):
492 self.hash = {}
493 for x, s in enumerate(self.lines):
494 self.hash.setdefault(s, []).append(x)
495
496 491 def makerejlines(self, fname):
497 492 base = os.path.basename(fname)
498 493 yield "--- %s\n+++ %s\n" % (base, base)
@@ -574,8 +569,10 b' class patchfile(object):'
574 569 self.dirty = 1
575 570 return 0
576 571
577 # ok, we couldn't match the hunk. Lets look for offsets and fuzz it
578 self.hashlines()
572 # ok, we couldn't match the hunk. Lets look for offsets and fuzz it
573 self.hash = {}
574 for x, s in enumerate(self.lines):
575 self.hash.setdefault(s, []).append(x)
579 576 if h.hunk[-1][0] != ' ':
580 577 # if the hunk tried to put something at the bottom of the file
581 578 # override the start line and use eof here
General Comments 0
You need to be logged in to leave comments. Login now