--- a/rust/rhg/src/error.rs Mon Oct 31 16:15:30 2022 +0000
+++ b/rust/rhg/src/error.rs Mon Oct 31 16:15:54 2022 +0000
@@ -221,7 +221,12 @@
impl From<StatusError> for CommandError {
fn from(error: StatusError) -> Self {
- CommandError::abort(format!("{}", error))
+ match error {
+ StatusError::Pattern(_) => {
+ CommandError::unsupported(format!("{}", error))
+ }
+ _ => CommandError::abort(format!("{}", error)),
+ }
}
}
--- a/tests/test-hgignore.t Mon Oct 31 16:15:30 2022 +0000
+++ b/tests/test-hgignore.t Mon Oct 31 16:15:54 2022 +0000
@@ -59,36 +59,24 @@
? syntax
$ echo "*.o" > .hgignore
-#if no-rhg
$ hg status
abort: $TESTTMP/ignorerepo/.hgignore: invalid pattern (relre): *.o (glob)
[255]
-#endif
-#if rhg
- $ hg status
- Unsupported syntax regex parse error:
- ^(?:*.o)
- ^
- error: repetition operator missing expression
- [255]
-#endif
$ echo 're:^(?!a).*\.o$' > .hgignore
-#if no-rhg
$ hg status
A dir/b.o
? .hgignore
? a.c
? a.o
? syntax
-#endif
#if rhg
- $ hg status
- Unsupported syntax regex parse error:
+ $ hg status --config rhg.on-unsupported=abort
+ unsupported feature: Unsupported syntax regex parse error:
^(?:^(?!a).*\.o$)
^^^
error: look-around, including look-ahead and look-behind, is not supported
- [255]
+ [252]
#endif
Ensure given files are relative to cwd