Mercurial > hg
changeset 13406:5e57c199848d
debugignore: catch the case when ignore.includepat doesn't exist
In testing of my recent addition of a debugignore command, some of my MacHg
users uncovered the exceptional case that if there is no ignore patterns of any
kind then a traceback occurred. Catch and fix this case.
author | jfh <jason@jasonfharris.com> |
---|---|
date | Tue, 15 Feb 2011 23:23:16 +1300 |
parents | 682edefe7dbb |
children | 354f304152ad |
files | mercurial/commands.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Tue Feb 15 02:17:43 2011 +0100 +++ b/mercurial/commands.py Tue Feb 15 23:23:16 2011 +1300 @@ -1355,7 +1355,10 @@ def debugignore(ui, repo, *values, **opts): """display the combined ignore pattern""" ignore = repo.dirstate._ignore - ui.write("%s\n" % ignore.includepat) + if hasattr(ignore, 'includepat'): + ui.write("%s\n" % ignore.includepat) + else: + raise util.Abort(_("no ignore patterns found")) def debugindex(ui, repo, file_, **opts): """dump the contents of an index file"""