debugignore: use getattr instead of hasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 16:36:56 -0500
changeset 14949 a4435770cf57
parent 14948 32302480b402
child 14950 144e97421f6b
debugignore: use getattr instead of hasattr
mercurial/commands.py
--- a/mercurial/commands.py	Mon Jul 25 15:32:42 2011 -0500
+++ b/mercurial/commands.py	Mon Jul 25 16:36:56 2011 -0500
@@ -1659,8 +1659,9 @@
 def debugignore(ui, repo, *values, **opts):
     """display the combined ignore pattern"""
     ignore = repo.dirstate._ignore
-    if hasattr(ignore, 'includepat'):
-        ui.write("%s\n" % ignore.includepat)
+    includepat = getattr(ignore, 'includepat', None)
+    if includepat is not None:
+        ui.write("%s\n" % includepat)
     else:
         raise util.Abort(_("no ignore patterns found"))