Mon, 06 Aug 2018 12:52:33 -0700 match: add visitchildrenset complement to visitdir
spectral <spectral@google.com> [Mon, 06 Aug 2018 12:52:33 -0700] rev 38955
match: add visitchildrenset complement to visitdir `visitdir(d)` lets a caller query whether the directory is part of the matcher. It can receive a response of 'all' (yes, and all children, you can stop calling visitdir now), False (no, and no children either), or True (yes, either something in this directory or a child is part of the matcher). `visitchildrenset(d)` augments that by instead of returning True, it returns a list of items to actually investigate. With this, code can be modified from: for f in self.all_items: if match.visitdir(self.dir + '/' + f): <do stuff> to be: for f in self.all_items.intersect(match.visitchildrenset(self.dir)): <do stuff> use of this function can provide significant performance improvements, especially when using narrow (so that the matcher is much smaller than the stuff we see on disk) and/or treemanifests (so that we can avoid loading manifests for trees that aren't part of the matcher). Differential Revision: https://phab.mercurial-scm.org/D4130
Mon, 06 Aug 2018 12:52:22 -0700 includematcher: separate "parents" from "dirs"
spectral <spectral@google.com> [Mon, 06 Aug 2018 12:52:22 -0700] rev 38954
includematcher: separate "parents" from "dirs" A future patch will make use of this separation so that we can make more intelligent decisions about what to investigate/load when the matcher is in use. Currently, even with this patch, we typically use the 'visitdir' call to identify if we can skip some directory, something along the lines of: for f in all_items: if match.visitdir(f): <do stuff> This can be slower than we'd like if there are a lot of items; it requires N calls to match.visitdir in the best case. Commonly, especially with 'narrow', we have a situation where we do some work for the directory, possibly just loading it from disk (when using treemanifests) and then check if we should be interacting with it at all, which can be a huge slowdown in some pathological cases. Differential Revision: https://phab.mercurial-scm.org/D4129
Sun, 05 Aug 2018 18:31:19 -0700 match: add tests for visitdir functionality
spectral <spectral@google.com> [Sun, 05 Aug 2018 18:31:19 -0700] rev 38953
match: add tests for visitdir functionality There are a few cases that we could have done better with some additional logic; I tried to annotate these when I noticed them, but may have missed some. The tests are not exhaustive; there are certainly some patterns that I didn't test well, and many that I didn't test at all. The primary motivation was to get coverage on visitdir so that I can cover identical cases in a similar method I'm working on, to make sure that this new method behaves the same (or better). Differential Revision: https://phab.mercurial-scm.org/D4128
Mon, 23 Jul 2018 22:51:53 -0700 mergetool: warn if ui.merge points to nonexistent tool
Martin von Zweigbergk <martinvonz@google.com> [Mon, 23 Jul 2018 22:51:53 -0700] rev 38952
mergetool: warn if ui.merge points to nonexistent tool This adds a warning when ui.merge is configured but points to an executable that doesn't exist. It gets printed once per fail, but that seems to be how our other warnings about merge tools are reported. Differential Revision: https://phab.mercurial-scm.org/D3975
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -4 +4 +10 +30 +100 +300 +1000 +3000 +10000 tip