# HG changeset patch # User immerrr # Date 1330011741 -14400 # Node ID ccdd5825847184b19f8e600457e0a11f7a760bcc # Parent fd72c5cd06332be03a1043b3150e4fc8c2460049 crpatch.parsepatch: when splitting diff hunk into smaller ones, account after-context when calculating their start lines diff --git a/crecord/crpatch.py b/crecord/crpatch.py --- a/crecord/crpatch.py +++ b/crecord/crpatch.py @@ -541,8 +541,8 @@ self.before, self.changedlines, self.context) self.header.hunks.append(h) self.stream.append(h) - self.fromline += len(self.before) + h.removed - self.toline += len(self.before) + h.added + self.fromline += len(self.before) + h.removed + len(self.context) + self.toline += len(self.before) + h.added + len(self.context) self.before = [] self.changedlines = [] self.context = []