comparison tests/test-fileset.t @ 38690:5d9749c598f0

fileset: remove callexisting flag and mctx.existing() (API) They are no longer needed since any files are included as long as they are passed in to the matcher.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Jun 2018 22:31:51 +0900
parents ff5b6fca1082
children 0c5d131fa428
comparison
equal deleted inserted replaced
38689:ff5b6fca1082 38690:5d9749c598f0
445 con.xml 445 con.xml
446 dos 446 dos
447 mac 447 mac
448 mixed 448 mixed
449 unknown 449 unknown
450
451 Test detection of unintentional 'matchctx.existing()' invocation
452
453 $ cat > $TESTTMP/existingcaller.py <<EOF
454 > from mercurial import registrar
455 >
456 > filesetpredicate = registrar.filesetpredicate()
457 > @filesetpredicate(b'existingcaller()', callexisting=False)
458 > def existingcaller(mctx, x):
459 > # this 'mctx.existing()' invocation is unintentional
460 > existing = set(mctx.existing())
461 > return mctx.predicate(existing.__contains__, cache=False)
462 > EOF
463
464 $ cat >> .hg/hgrc <<EOF
465 > [extensions]
466 > existingcaller = $TESTTMP/existingcaller.py
467 > EOF
468
469 $ fileset 'existingcaller()' 2>&1 | tail -1
470 *ProgrammingError: *unexpected existing() invocation* (glob)
471 450
472 Test 'revs(...)' 451 Test 'revs(...)'
473 ================ 452 ================
474 453
475 small reminder of the repository state 454 small reminder of the repository state