rust/hg-core/src/matchers.rs
changeset 44852 fd3b94f1712d
parent 44832 ad1ec40975aa
parent 44779 b15a37d85dbe
child 44870 9f96beb9bafe
--- a/rust/hg-core/src/matchers.rs	Sun May 17 18:33:45 2020 -0400
+++ b/rust/hg-core/src/matchers.rs	Tue May 26 08:07:24 2020 -0700
@@ -366,6 +366,10 @@
     let pattern_string = unsafe { String::from_utf8_unchecked(escaped_bytes) };
     let re = regex::bytes::RegexBuilder::new(&pattern_string)
         .unicode(false)
+        // Big repos with big `.hgignore` will hit the default limit and
+        // incur a significant performance hit. One repo's `hg status` hit
+        // multiple *minutes*.
+        .dfa_size_limit(50 * (1 << 20))
         .build()
         .map_err(|e| PatternError::UnsupportedSyntax(e.to_string()))?;