[Request] [+ ] D8508: rust-regex: fix support for verbatim `re:` syntax

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Thu May 7 22:17:05 UTC 2020


Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  There was no test to bring this (and consequently the previous anchoring fixes)
  to my attention, so I added one.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D8508

AFFECTED FILES
  rust/hg-core/src/filepatterns.rs
  tests/test-hgignore.t

CHANGE DETAILS

diff --git a/tests/test-hgignore.t b/tests/test-hgignore.t
--- a/tests/test-hgignore.t
+++ b/tests/test-hgignore.t
@@ -28,6 +28,18 @@
 
   $ rm foo bar baz .hgignore makeignore.py
 
+test verbatim "re:" patterns
+
+  $ touch test
+  $ touch test2  # don't anchor the end
+  $ mkdir a
+  $ touch a/test # don't anchor the start either
+  $ echo "re:test" > .hgignore
+  $ hg status
+  ? .hgignore
+  $ rm test test2 a/test .hgignore
+  $ rmdir a
+
   $ touch a.o
   $ touch a.c
   $ touch syntax
diff --git a/rust/hg-core/src/filepatterns.rs b/rust/hg-core/src/filepatterns.rs
--- a/rust/hg-core/src/filepatterns.rs
+++ b/rust/hg-core/src/filepatterns.rs
@@ -312,7 +312,7 @@
     static ref SYNTAXES: FastHashMap<&'static [u8], &'static [u8]> = {
         let mut m = FastHashMap::default();
 
-        m.insert(b"re".as_ref(), b"relre:".as_ref());
+        m.insert(b"re".as_ref(), b"re:".as_ref());
         m.insert(b"regexp".as_ref(), b"relre:".as_ref());
         m.insert(b"glob".as_ref(), b"relglob:".as_ref());
         m.insert(b"rootglob".as_ref(), b"rootglob:".as_ref());



To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200507/84c32b46/attachment.html>


More information about the Mercurial-patches mailing list