Mercurial > hg-stable
changeset 14949:a4435770cf57
debugignore: use getattr instead of hasattr
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 25 Jul 2011 16:36:56 -0500 |
parents | 32302480b402 |
children | 144e97421f6b |
files | mercurial/commands.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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"))