# HG changeset patch # User Jun Wu # Date 1504309470 25200 # Node ID 11499bad035999f0bc83bfb86fb117da20775b80 # Parent e267d4ee4f2d0d6bf961828ceec5748c385c8ce1 check-code: forbid "\S" in egrep regular expression BSD `egrep` does not like it. So let's forbid it. Differential Revision: https://phab.mercurial-scm.org/D610 diff -r e267d4ee4f2d -r 11499bad0359 contrib/check-code.py --- a/contrib/check-code.py Fri Sep 01 15:47:32 2017 -0700 +++ b/contrib/check-code.py Fri Sep 01 16:44:30 2017 -0700 @@ -119,6 +119,7 @@ (r'\[[^\]]+==', '[ foo == bar ] is a bashism, use [ foo = bar ] instead'), (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w', "use egrep for extended grep syntax"), + (r'(^|\|\s*)e?grep .*\\S', "don't use \\S in regular expression"), (r'(?&1 | egrep '^\S*Error' + $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'parents=0' 2>&1 | egrep '^RuntimeError' RuntimeError: can't reuse the manifest: its p1 doesn't match the new ctx p1 $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'user=foo '