2018-12-06 04:56:42 +03:00
|
|
|
#require no-windows
|
|
|
|
|
|
|
|
Explore the semi-mysterious matchmod.match API
|
|
|
|
|
|
|
|
$ newrepo
|
|
|
|
$ mkdir 'a*1' 'a*2'
|
|
|
|
$ touch 'a*1/a' 'a*2/b'
|
|
|
|
$ hg ci -m 1 -A 'a*1/a' 'a*2/b' -q 2>&1 | sort
|
|
|
|
warning: filename contains '*', which is reserved on Windows: 'a*1/a'
|
|
|
|
warning: filename contains '*', which is reserved on Windows: 'a*2/b'
|
|
|
|
|
|
|
|
"patterns="
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", patterns=["a*"])))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
[]
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", patterns=["a*1"])))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
[]
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", patterns=["a*/*"])))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
['a*1/a', 'a*2/b']
|
|
|
|
|
|
|
|
"include="
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", include=["a*"])))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
['a*1/a', 'a*2/b']
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", include=["a*1"])))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
['a*1/a']
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", include=["a*/*"])))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
['a*1/a', 'a*2/b']
|
|
|
|
|
|
|
|
"patterns=" with "default='path'"
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", patterns=["a*"], default="path")))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
[]
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", patterns=["a*1"], default="path")))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
['a*1/a']
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", patterns=["a*/*"], default="path")))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
[]
|
|
|
|
|
|
|
|
"include=" with "default='path'" (ex. "default=" has no effect on "include=")
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", include=["a*"], default="path")))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
['a*1/a', 'a*2/b']
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", include=["a*1"], default="path")))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
['a*1/a']
|
|
|
|
|
2019-12-13 21:27:16 +03:00
|
|
|
$ hg dbsh -c 'ui.write("%s\n" % str(list(repo["."].walk(m.match.match(repo.root, "", include=["a*/*"], default="path")))))'
|
2018-12-06 04:56:42 +03:00
|
|
|
['a*1/a', 'a*2/b']
|