diff mercurial/registrar.py @ 38830:bfd5def3fe02

fileset: roughly adjust weights of functions ... in order to move status predicates far away from basic patterns. I don't know if each weight is appropriate, but it should be good enough as a start.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 22 Jul 2018 11:47:29 +0900
parents 7e7e2b2ff284
children 61ab546b71c3
line wrap: on
line diff
--- a/mercurial/registrar.py	Sat Jul 21 15:52:26 2018 +0900
+++ b/mercurial/registrar.py	Sun Jul 22 11:47:29 2018 +0900
@@ -250,6 +250,15 @@
     Optional argument 'weight' indicates the estimated run-time cost, useful
     for static optimization, default is 1. Higher weight means more expensive.
 
+    ====== =============================================================
+    Weight Description and examples
+    ====== =============================================================
+    0.5    basic match patterns (e.g. a symbol)
+    10     computing status (e.g. added()) or accessing a few files
+    30     reading file content for each (e.g. grep())
+    50     scanning working directory (ignored())
+    ====== =============================================================
+
     'filesetpredicate' instance in example above can be used to
     decorate multiple functions.