[PATCH] mdiff: use fallback arg of get() instead of if-clause

Christian Ebert blacktrash at gmx.net
Thu Jan 18 07:56:32 CST 2007


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1169128483 -3600
# Node ID b13889f4855231a202605ec3be08a257d7e09b58
# Parent  bbdba01cce28a329de71380441935c198cda5069
mdiff: use fallback arg of get() instead of if-clause

diff -r bbdba01cce28 -r b13889f48552 mercurial/mdiff.py
--- a/mercurial/mdiff.py	Wed Jan 17 22:19:36 2007 +0100
+++ b/mercurial/mdiff.py	Thu Jan 18 14:54:43 2007 +0100
@@ -38,14 +38,9 @@
         'ignoreblanklines': False,
         }
 
-    __slots__ = defaults.keys()
-
     def __init__(self, **opts):
-        for k in self.__slots__:
-            v = opts.get(k)
-            if v is None:
-                v = self.defaults[k]
-            setattr(self, k, v)
+        for k in self.defaults:
+            setattr(self, k, opts.get(k, self.defaults[k]))
 
 defaultopts = diffopts()
 


More information about the Mercurial-devel mailing list