mercurial/patch.py
changeset 41474 d1d3094b54f9
parent 41423 4a33a6bf2b52
child 41512 a02c8b605d31
--- a/mercurial/patch.py	Wed Jan 30 03:56:35 2019 +0530
+++ b/mercurial/patch.py	Mon Jan 28 18:00:14 2019 -0800
@@ -1609,6 +1609,7 @@
             self.headers = []
 
         def addrange(self, limits):
+            self.addcontext([])
             fromstart, fromend, tostart, toend, proc = limits
             self.fromline = int(fromstart)
             self.toline = int(tostart)
@@ -1629,6 +1630,8 @@
             if self.context:
                 self.before = self.context
                 self.context = []
+            if self.hunk:
+                self.addcontext([])
             self.hunk = hunk
 
         def newfile(self, hdr):