Show More
@@ -669,17 +669,17 b' class binhunk:' | |||
|
669 | 669 | def new(self): |
|
670 | 670 | return [self.text] |
|
671 | 671 | |
|
672 |
def extract(self, |
|
|
673 |
line = |
|
|
672 | def extract(self, lr): | |
|
673 | line = lr.readline() | |
|
674 | 674 | self.hunk.append(line) |
|
675 | 675 | while line and not line.startswith('literal '): |
|
676 |
line = |
|
|
676 | line = lr.readline() | |
|
677 | 677 | self.hunk.append(line) |
|
678 | 678 | if not line: |
|
679 | 679 | raise PatchError(_('could not extract binary patch')) |
|
680 | 680 | size = int(line[8:].rstrip()) |
|
681 | 681 | dec = [] |
|
682 |
line = |
|
|
682 | line = lr.readline() | |
|
683 | 683 | self.hunk.append(line) |
|
684 | 684 | while len(line) > 1: |
|
685 | 685 | l = line[0] |
@@ -688,7 +688,7 b' class binhunk:' | |||
|
688 | 688 | else: |
|
689 | 689 | l = ord(l) - ord('a') + 27 |
|
690 | 690 | dec.append(base85.b85decode(line[1:-1])[:l]) |
|
691 |
line = |
|
|
691 | line = lr.readline() | |
|
692 | 692 | self.hunk.append(line) |
|
693 | 693 | text = zlib.decompress(''.join(dec)) |
|
694 | 694 | if len(text) != size: |
@@ -806,7 +806,7 b' def scangitpatch(lr, firstline):' | |||
|
806 | 806 | gitlr.push(firstline) |
|
807 | 807 | (dopatch, gitpatches) = readgitpatch(gitlr) |
|
808 | 808 | fp.seek(pos) |
|
809 |
return |
|
|
809 | return dopatch, gitpatches | |
|
810 | 810 | |
|
811 | 811 | def iterhunks(ui, fp, sourcefile=None): |
|
812 | 812 | """Read a patch and yield the following events: |
@@ -871,7 +871,7 b' def iterhunks(ui, fp, sourcefile=None):' | |||
|
871 | 871 | if emitfile: |
|
872 | 872 | emitfile = False |
|
873 | 873 | yield 'file', (afile, bfile, current_hunk) |
|
874 |
current_hunk.extract( |
|
|
874 | current_hunk.extract(lr) | |
|
875 | 875 | elif x.startswith('diff --git'): |
|
876 | 876 | # check for git diff, scanning the whole patch file if needed |
|
877 | 877 | m = gitre.match(x) |
@@ -879,7 +879,7 b' def iterhunks(ui, fp, sourcefile=None):' | |||
|
879 | 879 | afile, bfile = m.group(1, 2) |
|
880 | 880 | if not git: |
|
881 | 881 | git = True |
|
882 |
|
|
|
882 | dopatch, gitpatches = scangitpatch(lr, x) | |
|
883 | 883 | yield 'git', gitpatches |
|
884 | 884 | for gp in gitpatches: |
|
885 | 885 | changed[gp.path] = gp |
General Comments 0
You need to be logged in to leave comments.
Login now