91259a696e598fb4b6807cda9b40eb72971e9209 braney Sat Sep 12 06:59:18 2026 -0700 cartTrackVarCatalog: catalog the faceted composite's groupBy, refs #37838 .groupBy says which of a faceted composite's two dimensions is kept together in the image: "sample" puts one sample's data types side by side, "dataType" puts the same data type for every sample side by side. Written by cartDump from facetedComposite.js and read back in hgTrackUi, both of which store it only if it is one of those two words, so nothing unvalidated reaches the """) return "\n".join(p) def main(): ap = argparse.ArgumentParser(description=__doc__) ap.add_argument("--json") ap.add_argument("--html") ap.add_argument("--check", action="store_true") ap.add_argument("--reconcile", action="store_true") ap.add_argument("--verbose", action="store_true", help="with --reconcile, also print the standing drift " "that needs no action") ap.add_argument("--update-baseline", dest="updateBaseline", action="store_true", help="rewrite %s from the current tree; read the diff " "before committing it" % os.path.basename(BASELINE_FILE)) args = ap.parse_args() cat = build() if args.updateBaseline: tree = harvested() if tree is None: return 1 cataloged, _, _ = cataloged_test() h = harvestModule() # harvested() above already proved it imports was = read_baseline() # The same two exclusions --reconcile makes, or accepting the backlog # would write back every filename the harvester reads as a name. now = set(n for n in tree if not cataloged(n) and not h.fileNameLike(n) and n not in h.hgConfNames(_RECORDS or [])) write_baseline(now, tree) print("wrote %s: %d names, %d added, %d dropped" % (BASELINE_FILE, len(now), len(now - was), len(was - now))) return 0 if args.reconcile: return 1 if reconcile(cat, verbose=args.verbose) else 0 if args.json: with open(args.json, "w") as f: json.dump(cat, f, indent=1) print("wrote %s" % args.json) if args.html: with open(args.html, "w") as f: f.write(render_html(cat)) print("wrote %s" % args.html) if args.check or not (args.json or args.html): c = counts(cat) for k in sorted(c): print("%-12s %s" % (k, c[k])) # every family referenced by a type must exist bad = 0 for name, t in TYPES.items(): for fam in t.get("families", []): key = fam.split(" ")[0] if key not in FAMILIES and key not in TYPES: print("unknown family %r referenced by type %r" % (fam, name), file=sys.stderr) bad += 1 if bad: return 1 print("families ok") bad += check_values() if bad: return 1 return 0 if __name__ == "__main__": sys.exit(main())