##// END OF EJS Templates
fileset: exclude deleted files from matchctx.existing()...
fileset: exclude deleted files from matchctx.existing() Running: $ hg debugfileset 'binary()' would traceback if there were one deleted file in the working directory. It happened because matchctx.existing() was filtering files against the ctx.__contains__() but deleted files are still considered part of workingctx.

File last commit:

r17365:8a0513bf stable
r17365:8a0513bf stable
Show More
test-fileset.t
83 lines | 1.0 KiB | text/troff | Tads3Lexer
Patrick Mezard
tests: test filesets with test-fileset.t
r17362 $ fileset() {
> hg debugfileset "$@"
> }
$ hg init repo
$ cd repo
$ echo a > a1
$ echo a > a2
$ echo b > b1
Patrick Mezard
test-fileset: test file status predicates
r17364 $ echo b > b2
Patrick Mezard
tests: test filesets with test-fileset.t
r17362 $ hg ci -Am addfiles
adding a1
adding a2
adding b1
Patrick Mezard
test-fileset: test file status predicates
r17364 adding b2
Patrick Mezard
tests: test filesets with test-fileset.t
r17362
Test operators and basic patterns
$ fileset a1
a1
$ fileset 'a*'
a1
a2
$ fileset '"re:a\d"'
a1
a2
$ fileset 'a1 or a2'
a1
a2
$ fileset 'a1 | a2'
a1
a2
$ fileset 'a* and "*1"'
a1
$ fileset 'a* & "*1"'
a1
$ fileset 'not (r"a*")'
b1
Patrick Mezard
test-fileset: test file status predicates
r17364 b2
Patrick Mezard
tests: test filesets with test-fileset.t
r17362 $ fileset '! ("a*")'
b1
Patrick Mezard
test-fileset: test file status predicates
r17364 b2
Patrick Mezard
fileset: actually implement 'minusset'...
r17363 $ fileset 'a* - a1'
a2
Patrick Mezard
tests: test filesets with test-fileset.t
r17362
Patrick Mezard
test-fileset: test file status predicates
r17364 Test files status
$ rm a1
$ hg rm a2
$ echo b >> b2
$ hg cp b1 c1
$ echo c > c2
$ echo c > c3
$ cat > .hgignore <<EOF
> \.hgignore
> 2$
> EOF
$ fileset 'modified()'
b2
$ fileset 'added()'
c1
$ fileset 'removed()'
a2
$ fileset 'deleted()'
a1
$ fileset 'unknown()'
c3
$ fileset 'ignored()'
.hgignore
c2
$ fileset 'hgignore()'
a2
b2
$ fileset 'clean()'
b1
$ fileset 'copied()'
c1
Patrick Mezard
fileset: exclude deleted files from matchctx.existing()...
r17365 Test files properties
>>> file('bin', 'wb').write('\0a')
$ fileset 'binary()'