mercurial/crecord.py
changeset 25821 d68544b69736
parent 25820 701d8c362aa2
child 25940 f4356e5094ba
--- a/mercurial/crecord.py	Fri Jul 17 13:41:17 2015 -0700
+++ b/mercurial/crecord.py	Fri Jul 17 13:44:01 2015 -0700
@@ -1612,8 +1612,12 @@
 
         # add 1 so to account for last line text reaching end of line
         self.numpadlines = self.getnumlinesdisplayed(ignorefolding=True) + 1
-        self.chunkpad = curses.newpad(self.numpadlines, self.xscreensize)
 
+        try:
+            self.chunkpad = curses.newpad(self.numpadlines, self.xscreensize)
+        except curses.error:
+            self.initerr = _('this diff is too large to be displayed')
+            return
         # initialize selecteitemendline (initial start-line is 0)
         self.selecteditemendline = self.getnumlinesdisplayed(
             self.currentselecteditem, recursechildren=False)