fece8651e5d986dc199aa4fa231b35863937ca4a
braney
  Sat Aug 1 12:05:09 2026 -0700
hgConfCatalog: make --reconcile fit for a nightly run refs #37925

--reconcile printed its whole report whether or not anything had changed, so
as cron mail it would have been seventeen lines of standing drift every night
with the one new setting buried in it.  It now prints only what somebody has
to act on, which is a setting the tree reads that the catalog has not
classified, and a boolean flag filed neither gate nor knob.  The drift moves
behind --verbose.  Silent and exit 0 means nothing new.

Adds the missing row for blatNewPageBanner, which was the one real finding
sitting in the report, and files it as a gate with the argument for calling it
a knob recorded.

A scan that finds almost nothing now fails instead of reporting all clear,
since pointed at an empty tree every check below it comes up empty, and
KENT_SRC lets a nightly aim at a pristine checkout rather than a working tree
where a stray .c file would show up as a finding.

diff --git src/hg/utils/hgConfCatalog/harvestHgConf.py src/hg/utils/hgConfCatalog/harvestHgConf.py
index a75c0a5c79a..697820aeb9c 100755
--- src/hg/utils/hgConfCatalog/harvestHgConf.py
+++ src/hg/utils/hgConfCatalog/harvestHgConf.py
@@ -59,31 +59,34 @@
     harvestHgConf.py --profiles         # cfgOption2 suffix families
     harvestHgConf.py --docs             # what product/ex.hg.conf documents
     harvestHgConf.py --age              # first-seen version per variable
     harvestHgConf.py --age --refresh    # rebuild the age cache (slow)
     harvestHgConf.py --json out.json
 """
 
 import argparse
 import collections
 import json
 import os
 import re
 import subprocess
 import sys
 
-ROOT = os.path.expanduser("~/kent/src")
+# The tree to scan.  KENT_SRC lets a nightly run point at a pristine
+# checkout instead of somebody's working tree, where a stray .c file or a
+# half-finished edit would show up as a finding.
+ROOT = os.environ.get("KENT_SRC") or os.path.expanduser("~/kent/src")
 
 # Walked for call sites.  lib is in here because a few generic settings
 # (udc.*, noSqlInj.*) are read from the core library rather than from hg.
 SCAN_ROOTS = ["hg", "lib"]
 
 # Not source we care about, and walking them is slow.
 SKIP_DIRS = {"htdocs", "js", "tests", "expected", "input", "trackDb",
              "makeDb/doc", "CVS", ".git", "python", "lowelab", "__pycache__"}
 
 # Mined for #define values in addition to everything under SCAN_ROOTS.
 MACRO_DIRS = ["inc", "hg/inc"]
 
 # The documented example configs shipped to mirrors.  These are the closest
 # thing the tree has to hg.conf documentation today, and the thing the catalog
 # is reconciled against.