Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/main.rs @ 52557:b89c934e6269
rust-hgignore: add a scripting command to print the hgignore regexp
Add a command `script::hgignore --print-re` to print the
hgignore regexp.
One complication is that the `rootfilesin`-only matcher doesn't use a
regular expression, and the existing converts it to something that's
not a regular expression.
We add code to handle that case.
Since this command is now sufficient to generate a tidy-looking
regexp for scripting, this frees up the "debug" command to report
the internal regexp used by the regex engine, so we make that
change too.
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Fri, 13 Dec 2024 15:05:37 +0000 |
parents | a0587c1b633a |
children | 2d52ae3c5f76 |
line wrap: on
line diff
--- a/rust/rhg/src/main.rs Fri Dec 06 20:27:59 2024 +0000 +++ b/rust/rhg/src/main.rs Fri Dec 13 15:05:37 2024 +0000 @@ -534,6 +534,7 @@ pub mod debugrhgsparse; pub mod files; pub mod root; + pub mod script_hgignore; pub mod status; } @@ -616,6 +617,7 @@ subcommand!(root), subcommand!(config), subcommand!(status), + subcommand!(script_hgignore), ]; let mut commands = Subcommands::new(); for cmd in subcommands {