comparison mercurial/debugcommands.py @ 32444:952017471f93

match: implement __repr__() and update users (API) fsmonitor and debugignore currently access matcher fields that I would consider implementation details, namely patternspat, includepat, and excludepat. Let' instead implement __repr__() and have the few users use that instead. Marked (API) because the fields can now be None.
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 22 May 2017 11:08:18 -0700
parents c942c83ac2ec
children 08d02c1d7e67
comparison
equal deleted inserted replaced
32443:bdc4861ffe59 32444:952017471f93
808 if so, show the ignore rule (file and line number) that matched it. 808 if so, show the ignore rule (file and line number) that matched it.
809 """ 809 """
810 ignore = repo.dirstate._ignore 810 ignore = repo.dirstate._ignore
811 if not files: 811 if not files:
812 # Show all the patterns 812 # Show all the patterns
813 includepat = getattr(ignore, 'includepat', None) 813 ui.write("%s\n" % repr(ignore))
814 if includepat is not None:
815 ui.write("%s\n" % includepat)
816 else:
817 raise error.Abort(_("no ignore patterns found"))
818 else: 814 else:
819 for f in files: 815 for f in files:
820 nf = util.normpath(f) 816 nf = util.normpath(f)
821 ignored = None 817 ignored = None
822 ignoredata = None 818 ignoredata = None