mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
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.
This commit is contained in:
parent
3e84017cf0
commit
48eb3f266f
@ -1355,7 +1355,10 @@ def debugdate(ui, date, range=None, **opts):
|
||||
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"""
|
||||
|
Loading…
Reference in New Issue
Block a user