Mercurial > hg
comparison tests/test-fileset.t @ 38686:131aae58a316
fileset: add "tracked()" to explicitly select files in the revision
I'm going to rewrite filesets to be match predicates, which means basic
patterns such as '*' will no longer be "closed" to the subset constructed
from the ctx.
Good thing is that 'hg status "set:not binary()"' can include unknown files
out of the box, and fileset computation will likely to be faster as we won't
have to walk dirstate twice, for example. Bad thing is that we can't select
files at a certain revision by 'set:revs(REV, **)' since '**' is "open" to
any paths. So, this patch introduces "tracked()" as a replacement for the '**'
in the example above.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 10 Jun 2018 22:19:56 +0900 |
parents | 3d8ef60569d8 |
children | ff5b6fca1082 |
comparison
equal
deleted
inserted
replaced
38685:80466fd85ac9 | 38686:131aae58a316 |
---|---|
522 ? unknown | 522 ? unknown |
523 | 523 |
524 Test files at -r0 should be filtered by files at wdir | 524 Test files at -r0 should be filtered by files at wdir |
525 ----------------------------------------------------- | 525 ----------------------------------------------------- |
526 | 526 |
527 $ fileset -r0 '* and revs("wdir()", *)' | 527 $ fileset -r0 'tracked() and revs("wdir()", tracked())' |
528 a1 | 528 a1 |
529 b1 | 529 b1 |
530 b2 | 530 b2 |
531 | 531 |
532 Test that "revs()" work at all | 532 Test that "revs()" work at all |
588 | 588 |
589 $ hg status --removed --rev 0 --rev 1 | 589 $ hg status --removed --rev 0 --rev 1 |
590 R a2 | 590 R a2 |
591 $ fileset "status(0, 1, removed())" | 591 $ fileset "status(0, 1, removed())" |
592 a2 | 592 a2 |
593 $ fileset "* and status(0, 1, removed())" | 593 $ fileset "tracked() and status(0, 1, removed())" |
594 $ fileset -r 4 "status(0, 1, removed())" | 594 $ fileset -r 4 "status(0, 1, removed())" |
595 a2 | 595 a2 |
596 $ fileset -r 4 "* and status(0, 1, removed())" | 596 $ fileset -r 4 "tracked() and status(0, 1, removed())" |
597 $ fileset "revs('4', * and status(0, 1, removed()))" | 597 $ fileset "revs('4', tracked() and status(0, 1, removed()))" |
598 $ fileset "revs('0', * and status(0, 1, removed()))" | 598 $ fileset "revs('0', tracked() and status(0, 1, removed()))" |
599 a2 | 599 a2 |
600 | 600 |
601 check wdir() | 601 check wdir() |
602 ------------ | 602 ------------ |
603 | 603 |