704 return l[top:len(l)-bot] |
704 return l[top:len(l)-bot] |
705 return l |
705 return l |
706 |
706 |
707 def old(self, fuzz=0, toponly=False): |
707 def old(self, fuzz=0, toponly=False): |
708 return self.fuzzit(self.a, fuzz, toponly) |
708 return self.fuzzit(self.a, fuzz, toponly) |
709 |
709 |
710 def newctrl(self): |
710 def newctrl(self): |
711 res = [] |
711 res = [] |
712 for x in self.hunk: |
712 for x in self.hunk: |
713 c = x[0] |
713 c = x[0] |
714 if c == ' ' or c == '+': |
714 if c == ' ' or c == '+': |
840 def applydiff(ui, fp, changed, strip=1, sourcefile=None, reverse=False, |
840 def applydiff(ui, fp, changed, strip=1, sourcefile=None, reverse=False, |
841 rejmerge=None, updatedir=None): |
841 rejmerge=None, updatedir=None): |
842 """reads a patch from fp and tries to apply it. The dict 'changed' is |
842 """reads a patch from fp and tries to apply it. The dict 'changed' is |
843 filled in with all of the filenames changed by the patch. Returns 0 |
843 filled in with all of the filenames changed by the patch. Returns 0 |
844 for a clean patch, -1 if any rejects were found and 1 if there was |
844 for a clean patch, -1 if any rejects were found and 1 if there was |
845 any fuzz.""" |
845 any fuzz.""" |
846 |
846 |
847 def scangitpatch(fp, firstline, cwd=None): |
847 def scangitpatch(fp, firstline, cwd=None): |
848 '''git patches can modify a file, then copy that file to |
848 '''git patches can modify a file, then copy that file to |
849 a new file, but expect the source to be the unmodified form. |
849 a new file, but expect the source to be the unmodified form. |
850 So we scan the patch looking for that case so we can do |
850 So we scan the patch looking for that case so we can do |