# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1466665581 -28800
# Node ID 53e3c39fff132e88098aaf279624e9596ef27a7f
# Parent  ed7f35f52927168102bf3a3d4727fb838839eebf
checker: go back to using hg files with -I and -X

Because -X is a bit simpler than a fileset that also excludes some files (to
code and just visually).

Also rename property to "include" for clarity.

diff -r ed7f35f52927 -r 53e3c39fff13 checker.py
--- a/checker.py	Thu Jun 23 14:58:09 2016 +0800
+++ b/checker.py	Thu Jun 23 15:06:21 2016 +0800
@@ -90,10 +90,14 @@
     if ok:
         print('# C&O task: checks')
         for linter in config['linters']:
-            if 'cmd' not in linter or 'files' not in linter:
+            if 'include' not in linter:
                 continue
 
-            cmd = ['hg', 'files', 'set:' + ' or '.join(linter['files'])]
+            cmd = ['hg', 'files']
+            for pat in linter['include']:
+                cmd.extend(('-I', pat))
+            for pat in linter.get('exclude', []):
+                cmd.extend(('-X', pat))
             files = run(cmd, silent=True, get_output=True, ignore_codes=(1,))
             if files is False:
                 ok = False