yuja requested changes to this revision. yuja added a comment. This revision now requires changes to proceed.
Can't we apply `_updateexceptions()` out of the `revset.match*()`? It's horrible that a revset query does mutate the repo. # somewhere near scmutil.revrange() tree = revsetlang.parse(spec) symbols = revsetlang.hashlikesymbols(tree) ... continue _updateexceptions() INLINE COMMENTS > revset.py:2241 > + n = int(symbol) > + if n <= maxrev: > + # It's a rev number Perhaps this can be moved to `_updateexceptions()` phase, so that we can simply collect hash-like strings without the knowledge of the tip revision. > revset.py:2248 > + > +def gethashsymbols(tree, maxrev): > + """ Please move this to `revsetlang` module. > revset.py:2258 > + results = [] > + if len(tree) in (2, 3) and tree[0] == "symbol": > + results.append(tree[1]) No need to test the length. > revset.py:2260 > + results.append(tree[1]) > + elif tree[0] == "func" and tree[1] == _listtuple: > + # the optimiser will group sequence of hash request We can get rid of it by processing a pre-optimized tree. > revset.py:2266 > + results += gethashsymbols(subtree, maxrev) > + # return directly, we don't need to filter symbols again > + return results Seems tricky. Instead, test the _ishashsymbol() before adding to the results list? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1143 To: pulkit, #hg-reviewers, indygreg, yuja Cc: yuja, indygreg, dlax, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel