Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 14949:a4435770cf57
debugignore: use getattr instead of hasattr
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 25 Jul 2011 16:36:56 -0500 |
parents | d3bb825ddae3 |
children | ce7e3014fda7 |
comparison
equal
deleted
inserted
replaced
14948:32302480b402 | 14949:a4435770cf57 |
---|---|
1657 | 1657 |
1658 @command('debugignore', [], '') | 1658 @command('debugignore', [], '') |
1659 def debugignore(ui, repo, *values, **opts): | 1659 def debugignore(ui, repo, *values, **opts): |
1660 """display the combined ignore pattern""" | 1660 """display the combined ignore pattern""" |
1661 ignore = repo.dirstate._ignore | 1661 ignore = repo.dirstate._ignore |
1662 if hasattr(ignore, 'includepat'): | 1662 includepat = getattr(ignore, 'includepat', None) |
1663 ui.write("%s\n" % ignore.includepat) | 1663 if includepat is not None: |
1664 ui.write("%s\n" % includepat) | |
1664 else: | 1665 else: |
1665 raise util.Abort(_("no ignore patterns found")) | 1666 raise util.Abort(_("no ignore patterns found")) |
1666 | 1667 |
1667 @command('debugindex', | 1668 @command('debugindex', |
1668 [('c', 'changelog', False, _('open changelog')), | 1669 [('c', 'changelog', False, _('open changelog')), |