mercurial/mdiff.py
changeset 6467 65029a3aafc2
parent 5863 3d1f9dcecdea
child 6470 ac0bcd951c2c
--- a/mercurial/mdiff.py	Thu Apr 03 13:14:43 2008 +0200
+++ b/mercurial/mdiff.py	Fri Apr 04 22:15:14 2008 +0200
@@ -5,6 +5,7 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
+from i18n import _
 import bdiff, mpatch, re, struct, util, md5
 
 def splitnewlines(text):
@@ -47,6 +48,12 @@
                 v = self.defaults[k]
             setattr(self, k, v)
 
+        try:
+            self.context = int(self.context)
+        except ValueError:
+            raise util.Abort(_('diff context lines count must be '
+                               'an integer, not %r') % self.context)
+
 defaultopts = diffopts()
 
 def wsclean(opts, text):