diff mercurial/mdiff.py @ 6467:65029a3aafc2

Let --unified default to diff.unified (issue 1076)
author Patrick Mezard <pmezard@gmail.com>
date Fri, 04 Apr 2008 22:15:14 +0200
parents 3d1f9dcecdea
children ac0bcd951c2c
line wrap: on
line diff
--- 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):