diff tests/test-sparse.t @ 50821:28c0fcff24e5 stable

rhg: fix the bug where sparse config is interpreted as relglob instead of glob relglob apparently (in contrast with relpath) matches everywhere in the tree, whereas glob only matches at the root. The python version interprets these patterns as "glob" (see "normalize(include, b'glob', ...)" in match.py)
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Thu, 10 Aug 2023 19:00:19 +0100
parents 7e5be4a7cda7
children
line wrap: on
line diff
--- a/tests/test-sparse.t	Mon Aug 07 23:12:02 2023 +0200
+++ b/tests/test-sparse.t	Thu Aug 10 19:00:19 2023 +0100
@@ -21,6 +21,29 @@
 Verify basic --include
 
   $ hg up -q 0
+
+Test that sparse pattern by default is interpreted as "glob:", and is interpreted relative to the root.
+
+  $ hg debugsparse --reset
+  $ hg debugsparse -X 'foo*bar'
+  $ cat .hg/sparse
+  [exclude]
+  foo*bar
+
+  $ mk() { mkdir -p "$1"; touch "$1"/"$2"; }
+  $ mk 'foo' bar
+  $ mk 'foo-bar' x
+  $ mk 'unanchoredfoo-bar' x
+  $ mk 'foo*bar' x
+  $ mk 'dir/foo-bar' x
+  $ hg status --config rhg.on-unsupported=abort
+  ? dir/foo-bar/x
+  ? foo/bar
+  ? unanchoredfoo-bar/x
+  $ hg clean -a --no-confirm
+  $ rm -r foo*bar
+  $ hg debugsparse --reset
+
   $ hg debugsparse --include 'hide'
   $ ls -A
   .hg