comparison tests/test-narrow-patterns.t @ 39539:8d8e61df8259

narrowspec: validate patterns when loading and saving spec file Patterns should be normalized and validated before being passed into narrowspec.save(). Let's assert that by checking immediately before writing the narrow spec file. And let's assert that patterns loaded from the spec file also conform. Differential Revision: https://phab.mercurial-scm.org/D4524
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 11 Sep 2018 15:28:41 -0700
parents 0d572769046a
children c767e655ffda
comparison
equal deleted inserted replaced
39538:238a1480d7ad 39539:8d8e61df8259
437 437
438 $ hg tracked --addexclude set:ignored 438 $ hg tracked --addexclude set:ignored
439 abort: invalid prefix on narrow pattern: set:ignored 439 abort: invalid prefix on narrow pattern: set:ignored
440 (narrow patterns must begin with one of the following: path:, rootfilesin:) 440 (narrow patterns must begin with one of the following: path:, rootfilesin:)
441 [255] 441 [255]
442
443 $ cat .hg/store/narrowspec
444 [include]
445 path:dir1
446 path:dir1/dirA
447 [exclude]
448
449 $ cat > .hg/store/narrowspec << EOF
450 > [include]
451 > glob:**
452 > EOF
453
454 $ hg tracked
455 abort: invalid prefix on narrow pattern: glob:**
456 (narrow patterns must begin with one of the following: path:, rootfilesin:)
457 [255]
458
459 $ cat > .hg/store/narrowspec << EOF
460 > [include]
461 > path:.
462 > [exclude]
463 > set:ignored
464 > EOF
465
466 $ hg tracked
467 abort: invalid prefix on narrow pattern: set:ignored
468 (narrow patterns must begin with one of the following: path:, rootfilesin:)
469 [255]