Mercurial > hg
view tests/library-infinitepush.sh @ 44832:ad1ec40975aa
rust-regex: fix issues with regex anchoring and performance
It turns out that the way I tried to work around `regex`'s behavior difference
with `re2` and Python's `re` was 1) buggy and 2) much more complicated than
needed.
In a few words:
`regex` adds `.*` on either side of patterns when no start or end anchor is
present. My previous workaround put `^` or `$` for every pattern, which is
wrong even without the other 2 bugs on top of it.
Using `^(?:<patterns>)` right at the end of the `regex` path fixes the issue.
I've opened an issue to get a build option instead:
https://github.com/rust-lang/regex/issues/675
Differential Revision: https://phab.mercurial-scm.org/D8506
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Thu, 07 May 2020 23:52:08 +0200 |
parents | 03ff17a4bf53 |
children | 0826d684a1b5 |
line wrap: on
line source
scratchnodes() { for node in `find ../repo/.hg/scratchbranches/index/nodemap/* | sort`; do echo ${node##*/} `cat $node` done } scratchbookmarks() { for bookmark in `find ../repo/.hg/scratchbranches/index/bookmarkmap/* -type f | sort`; do echo "${bookmark##*/bookmarkmap/} `cat $bookmark`" done } setupcommon() { cat >> $HGRCPATH << EOF [extensions] infinitepush= [ui] ssh = python "$TESTDIR/dummyssh" [infinitepush] branchpattern=re:scratch/.* EOF } setupserver() { cat >> .hg/hgrc << EOF [infinitepush] server=yes indextype=disk storetype=disk reponame=babar EOF } waitbgbackup() { sleep 1 hg debugwaitbackup } mkcommitautobackup() { echo $1 > $1 hg add $1 hg ci -m $1 --config infinitepushbackup.autobackup=True } setuplogdir() { mkdir $TESTTMP/logs chmod 0755 $TESTTMP/logs chmod +t $TESTTMP/logs }