tests/test-hgignore.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Thu, 02 Jan 2025 14:50:06 +0100
changeset 52592 87ceb51d124c
parent 52557 b89c934e6269
permissions -rw-r--r--
run-tests: drop jython support I don't think we heard anything about jython support for the past 15 years, so let's drop special support for it in run-tests.py it is most probably broken at that point.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48068
bf8837e3d7ce dirstate: Remove the flat Rust DirstateMap implementation
Simon Sapin <simon.sapin@octobus.net>
parents: 47674
diff changeset
     1
#testcases dirstate-v1 dirstate-v2
47129
93eb6c8035a9 dirstate-tree: Add a dirstate-v1-tree variant of some tests
Simon Sapin <simon.sapin@octobus.net>
parents: 42864
diff changeset
     2
47281
6763913fa175 dirstate-v2: Add a variant of some tests, that uses the new format
Simon Sapin <simon.sapin@octobus.net>
parents: 47129
diff changeset
     3
#if dirstate-v2
48235
5c567aca080d dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48223
diff changeset
     4
  $ cat >> $HGRCPATH << EOF
5c567aca080d dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48223
diff changeset
     5
  > [format]
48674
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48295
diff changeset
     6
  > use-dirstate-v2=1
48235
5c567aca080d dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48223
diff changeset
     7
  > [storage]
5c567aca080d dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48223
diff changeset
     8
  > dirstate-v2.slow-path=allow
5c567aca080d dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48223
diff changeset
     9
  > EOF
47281
6763913fa175 dirstate-v2: Add a variant of some tests, that uses the new format
Simon Sapin <simon.sapin@octobus.net>
parents: 47129
diff changeset
    10
#endif
6763913fa175 dirstate-v2: Add a variant of some tests, that uses the new format
Simon Sapin <simon.sapin@octobus.net>
parents: 47129
diff changeset
    11
25869
a72e304df528 test: move ignore test run into a subdirectory
Durham Goode <durham@fb.com>
parents: 25283
diff changeset
    12
  $ hg init ignorerepo
a72e304df528 test: move ignore test run into a subdirectory
Durham Goode <durham@fb.com>
parents: 25283
diff changeset
    13
  $ cd ignorerepo
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    14
32605
e6ff007e107e match: introduce nevermatcher for when no ignore files are present
Siddharth Agarwal <sid0@fb.com>
parents: 32502
diff changeset
    15
debugignore with no hgignore should be deterministic:
e6ff007e107e match: introduce nevermatcher for when no ignore files are present
Siddharth Agarwal <sid0@fb.com>
parents: 32502
diff changeset
    16
  $ hg debugignore
e6ff007e107e match: introduce nevermatcher for when no ignore files are present
Siddharth Agarwal <sid0@fb.com>
parents: 32502
diff changeset
    17
  <nevermatcher>
e6ff007e107e match: introduce nevermatcher for when no ignore files are present
Siddharth Agarwal <sid0@fb.com>
parents: 32502
diff changeset
    18
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
    19
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    20
  $ rhg_debugignore() {
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    21
  >   echo debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    22
  >   hg debugignorerhg
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    23
  >   echo script::hgignore --print-re:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    24
  >   hg script::hgignore --print-re
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    25
  > }
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    26
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    27
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    28
  (?:)
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    29
  script::hgignore --print-re:
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
    30
  
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
    31
#endif
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
    32
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12376
diff changeset
    33
Issue562: .hgignore requires newline at end:
4439
4e521a3ee5eb Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents: 2009
diff changeset
    34
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    35
  $ touch foo
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    36
  $ touch bar
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    37
  $ touch baz
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    38
  $ cat > makeignore.py <<EOF
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    39
  > f = open(".hgignore", "w")
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    40
  > f.write("ignore\n")
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    41
  > f.write("foo\n")
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    42
  > # No EOL here
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    43
  > f.write("bar")
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    44
  > f.close()
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    45
  > EOF
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    46
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
    47
  $ "$PYTHON" makeignore.py
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    48
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    49
Should display baz only:
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    50
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    51
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    52
  ? baz
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    53
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    54
  $ rm foo bar baz .hgignore makeignore.py
4439
4e521a3ee5eb Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents: 2009
diff changeset
    55
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    56
  $ touch a.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    57
  $ touch a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    58
  $ touch syntax
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    59
  $ mkdir dir
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    60
  $ touch dir/a.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    61
  $ touch dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    62
  $ touch dir/c.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    63
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    64
  $ hg add dir/a.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    65
  $ hg commit -m 0
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    66
  $ hg add dir/b.o
4439
4e521a3ee5eb Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents: 2009
diff changeset
    67
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    68
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    69
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    70
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    71
  ? a.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    72
  ? dir/c.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    73
  ? syntax
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    74
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
    75
  $ echo "*.o" > .hgignore
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12312
diff changeset
    76
  $ hg status
25869
a72e304df528 test: move ignore test run into a subdirectory
Durham Goode <durham@fb.com>
parents: 25283
diff changeset
    77
  abort: $TESTTMP/ignorerepo/.hgignore: invalid pattern (relre): *.o (glob)
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12312
diff changeset
    78
  [255]
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    79
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    80
Test relre with flags (issue6759)
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    81
---------------------------------
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    82
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    83
regexp with flag is the first one
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    84
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    85
  $ echo 're:(?i)\.O$' > .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    86
  $ echo 're:.hgignore' >> .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    87
  $ hg status
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    88
  A dir/b.o
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    89
  ? a.c
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    90
  ? syntax
49605
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
    91
  $ hg debugignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
    92
  <includematcher includes='(?i:.*\\.O$)|.*.hgignore'>
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
    93
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
    94
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    95
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    96
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    97
  (?:\\A[\x00-	\x0b-\xf4\x8f\xbf\xbf]*(?:(?:\\.[Oo]\\z)|(?:[\x00-	\x0b-\xf4\x8f\xbf\xbf](?:hgignore)))) (esc)
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
    98
  script::hgignore --print-re:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
    99
  ^(?:(?i:.*\.O$)|.*.hgignore)
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   100
#endif
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   101
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   102
regex with flag is not the first one
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   103
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   104
  $ echo 're:.hgignore' > .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   105
  $ echo 're:(?i)\.O$' >> .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   106
  $ hg status
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   107
  A dir/b.o
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   108
  ? a.c
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   109
  ? syntax
49605
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   110
  $ hg debugignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   111
  <includematcher includes='.*.hgignore|(?i:.*\\.O$)'>
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   112
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   113
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   114
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   115
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   116
  (?:\\A[\x00-	\x0b-\xf4\x8f\xbf\xbf]*(?:(?:[\x00-	\x0b-\xf4\x8f\xbf\xbf](?:hgignore))|(?:\\.[Oo]\\z))) (esc)
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   117
  script::hgignore --print-re:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   118
  ^(?:.*.hgignore|(?i:.*\.O$))
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   119
#endif
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   120
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   121
flag in a pattern should affect that pattern only
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   122
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   123
  $ echo 're:(?i)\.O$' > .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   124
  $ echo 're:.HGIGNORE' >> .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   125
  $ hg status
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   126
  A dir/b.o
49604
086b0c4f8663 matcher: fix the issue with regex inline-flag in rust oo
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49603
diff changeset
   127
  ? .hgignore
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   128
  ? a.c
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   129
  ? syntax
49605
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   130
  $ hg debugignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   131
  <includematcher includes='(?i:.*\\.O$)|.*.HGIGNORE'>
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   132
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   133
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   134
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   135
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   136
  (?:\\A[\x00-	\x0b-\xf4\x8f\xbf\xbf]*(?:(?:\\.[Oo]\\z)|(?:[\x00-	\x0b-\xf4\x8f\xbf\xbf](?:HGIGNORE)))) (esc)
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   137
  script::hgignore --print-re:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   138
  ^(?:(?i:.*\.O$)|.*.HGIGNORE)
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   139
#endif
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   140
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   141
  $ echo 're:.HGIGNORE' > .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   142
  $ echo 're:(?i)\.O$' >> .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   143
  $ hg status
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   144
  A dir/b.o
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   145
  ? .hgignore
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   146
  ? a.c
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   147
  ? syntax
49605
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   148
  $ hg debugignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   149
  <includematcher includes='.*.HGIGNORE|(?i:.*\\.O$)'>
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   150
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   151
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   152
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   153
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   154
  (?:\\A[\x00-	\x0b-\xf4\x8f\xbf\xbf]*(?:(?:[\x00-	\x0b-\xf4\x8f\xbf\xbf](?:HGIGNORE))|(?:\\.[Oo]\\z))) (esc)
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   155
  script::hgignore --print-re:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   156
  ^(?:.*.HGIGNORE|(?i:.*\.O$))
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   157
#endif
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   158
49605
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   159
Check that '^' after flag is properly detected.
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   160
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   161
  $ echo 're:(?i)^[^a].*\.O$' > .hgignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   162
  $ echo 're:.HGIGNORE' >> .hgignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   163
  $ hg status
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   164
  A dir/b.o
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   165
  ? .hgignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   166
  ? a.c
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   167
  ? a.o
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   168
  ? syntax
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   169
  $ hg debugignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   170
  <includematcher includes='(?i:^[^a].*\\.O$)|.*.HGIGNORE'>
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   171
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   172
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   173
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   174
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   175
  (?:\\A(?:(?:\\A[\x00-@B-`b-\xf4\x8f\xbf\xbf][\x00-	\x0b-\xf4\x8f\xbf\xbf]*\\.[Oo]\\z)|(?:[\x00-	\x0b-\xf4\x8f\xbf\xbf]*[\x00-	\x0b-\xf4\x8f\xbf\xbf](?:HGIGNORE)))) (esc)
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   176
  script::hgignore --print-re:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   177
  ^(?:(?i:^[^a].*\.O$)|.*.HGIGNORE)
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   178
#endif
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   179
49605
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   180
  $ echo 're:.HGIGNORE' > .hgignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   181
  $ echo 're:(?i)^[^a].*\.O$' >> .hgignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   182
  $ hg status
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   183
  A dir/b.o
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   184
  ? .hgignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   185
  ? a.c
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   186
  ? a.o
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   187
  ? syntax
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   188
  $ hg debugignore
b3480822a251 matcher: do not prepend '.*' to pattern using ^ after flags
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49604
diff changeset
   189
  <includematcher includes='.*.HGIGNORE|(?i:^[^a].*\\.O$)'>
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   190
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   191
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   192
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   193
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   194
  (?:\\A(?:(?:[\x00-	\x0b-\xf4\x8f\xbf\xbf]*[\x00-	\x0b-\xf4\x8f\xbf\xbf](?:HGIGNORE))|(?:\\A[\x00-@B-`b-\xf4\x8f\xbf\xbf][\x00-	\x0b-\xf4\x8f\xbf\xbf]*\\.[Oo]\\z))) (esc)
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   195
  script::hgignore --print-re:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   196
  ^(?:.*.HGIGNORE|(?i:^[^a].*\.O$))
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   197
#endif
49603
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   198
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   199
further testing
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   200
---------------
3eda36e9b3d6 matcher: fix issues regex flag contained in pattern (issue6759)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49558
diff changeset
   201
49538
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   202
  $ echo 're:^(?!a).*\.o$' > .hgignore
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   203
  $ hg status
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   204
  A dir/b.o
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   205
  ? .hgignore
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   206
  ? a.c
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   207
  ? a.o
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   208
  ? syntax
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   209
#if rhg
49539
8076298b795a rhg: fallback to slow path on invalid patterns in hgignore
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49538
diff changeset
   210
  $ hg status --config rhg.on-unsupported=abort
8076298b795a rhg: fallback to slow path on invalid patterns in hgignore
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49538
diff changeset
   211
  unsupported feature: Unsupported syntax regex parse error:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   212
      ^(?!a).*\.o$
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   213
       ^^^
49538
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   214
  error: look-around, including look-ahead and look-behind, is not supported
49539
8076298b795a rhg: fallback to slow path on invalid patterns in hgignore
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49538
diff changeset
   215
  [252]
49538
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   216
#endif
b51e5c2ab5fd rhg: add a test involving hgignore lookaround
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49152
diff changeset
   217
33507
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   218
Ensure given files are relative to cwd
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   219
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   220
  $ echo "dir/.*\.o" > .hgignore
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   221
  $ hg status -i
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   222
  I dir/c.o
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   223
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   224
  $ hg debugignore dir/c.o dir/missing.o
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35230
diff changeset
   225
  dir/c.o is ignored
33507
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   226
  (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35230
diff changeset
   227
  dir/missing.o is ignored
33507
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   228
  (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   229
  $ cd dir
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   230
  $ hg debugignore c.o missing.o
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   231
  c.o is ignored
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   232
  (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   233
  missing.o is ignored
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   234
  (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   235
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   236
For icasefs, inexact matches also work, except for missing files
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   237
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   238
#if icasefs
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   239
  $ hg debugignore c.O missing.O
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   240
  c.o is ignored
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   241
  (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   242
  missing.O is not ignored
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   243
#endif
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   244
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   245
  $ cd ..
e9672de52a23 debugignore: eliminate inconsistencies with `hg status` (issue5222)
Matt Harbison <matt_harbison@yahoo.com>
parents: 33477
diff changeset
   246
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   247
  $ echo ".*\.o" > .hgignore
16487
4fe874697a4d tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents: 15447
diff changeset
   248
  $ hg status
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   249
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   250
  ? .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   251
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   252
  ? syntax
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   253
27326
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   254
Ensure that comments work:
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   255
42633
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   256
  $ touch 'foo#bar' 'quux#' 'quu0#'
27381
988367ac2a2a test-hgignore: conditionalize an illegal Windows filename
Matt Harbison <matt_harbison@yahoo.com>
parents: 27326
diff changeset
   257
#if no-windows
42633
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   258
  $ touch 'baz\' 'baz\wat' 'ba0\#wat' 'ba1\\' 'ba1\\wat' 'quu0\'
27381
988367ac2a2a test-hgignore: conditionalize an illegal Windows filename
Matt Harbison <matt_harbison@yahoo.com>
parents: 27326
diff changeset
   259
#endif
42633
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   260
27326
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   261
  $ cat <<'EOF' >> .hgignore
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   262
  > # full-line comment
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   263
  >   # whitespace-only comment line
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   264
  > syntax# pattern, no whitespace, then comment
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   265
  > a.c  # pattern, then whitespace, then comment
42631
24f0023bb8b1 hgignore: update \-escape test to reflect actual behavior
Yuya Nishihara <yuya@tcha.org>
parents: 41721
diff changeset
   266
  > baz\\# # (escaped) backslash, then comment
42632
c67e3f966867 hgignore: add a few more weird patterns to test case
Yuya Nishihara <yuya@tcha.org>
parents: 42631
diff changeset
   267
  > ba0\\\#w # (escaped) backslash, escaped comment character, then comment
c67e3f966867 hgignore: add a few more weird patterns to test case
Yuya Nishihara <yuya@tcha.org>
parents: 42631
diff changeset
   268
  > ba1\\\\# # (escaped) backslashes, then comment
27326
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   269
  > foo\#b # escaped comment character
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   270
  > quux\## escaped comment character at end of name
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   271
  > EOF
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   272
  $ hg status
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   273
  A dir/b.o
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   274
  ? .hgignore
42633
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   275
  ? quu0#
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   276
  ? quu0\ (no-windows !)
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   277
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   278
  $ cat <<'EOF' > .hgignore
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   279
  > .*\.o
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   280
  > syntax: glob
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   281
  > syntax# pattern, no whitespace, then comment
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   282
  > a.c  # pattern, then whitespace, then comment
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   283
  > baz\\#* # (escaped) backslash, then comment
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   284
  > ba0\\\#w* # (escaped) backslash, escaped comment character, then comment
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   285
  > ba1\\\\#* # (escaped) backslashes, then comment
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   286
  > foo\#b* # escaped comment character
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   287
  > quux\## escaped comment character at end of name
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   288
  > quu0[\#]# escaped comment character inside [...]
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   289
  > EOF
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   290
  $ hg status
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   291
  A dir/b.o
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   292
  ? .hgignore
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   293
  ? ba1\\wat (no-windows !)
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   294
  ? baz\wat (no-windows !)
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   295
  ? quu0\ (no-windows !)
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   296
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   297
  $ rm 'foo#bar' 'quux#' 'quu0#'
27381
988367ac2a2a test-hgignore: conditionalize an illegal Windows filename
Matt Harbison <matt_harbison@yahoo.com>
parents: 27326
diff changeset
   298
#if no-windows
42633
f78f305454fd hgignore: add escape syntax test for glob patterns
Yuya Nishihara <yuya@tcha.org>
parents: 42632
diff changeset
   299
  $ rm 'baz\' 'baz\wat' 'ba0\#wat' 'ba1\\' 'ba1\\wat' 'quu0\'
27381
988367ac2a2a test-hgignore: conditionalize an illegal Windows filename
Matt Harbison <matt_harbison@yahoo.com>
parents: 27326
diff changeset
   300
#endif
27326
ee2d7b5daa8a test-hgignore.t: add tests for comments
Bryan O'Sullivan <bos@serpentine.com>
parents: 25870
diff changeset
   301
33477
cc4632679cf9 tests: fix an incorrect description in test-ignore.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 33214
diff changeset
   302
Check that '^\.' does not ignore the root directory:
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
   303
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   304
  $ echo "^\." > .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   305
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   306
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   307
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   308
  ? a.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   309
  ? dir/c.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   310
  ? syntax
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
   311
23628
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   312
Test that patterns from ui.ignore options are read:
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   313
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   314
  $ echo > .hgignore
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   315
  $ cat >> $HGRCPATH << EOF
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   316
  > [ui]
25869
a72e304df528 test: move ignore test run into a subdirectory
Durham Goode <durham@fb.com>
parents: 25283
diff changeset
   317
  > ignore.other = $TESTTMP/ignorerepo/.hg/testhgignore
23628
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   318
  > EOF
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   319
  $ echo "glob:**.o" > .hg/testhgignore
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   320
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   321
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   322
  ? .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   323
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   324
  ? syntax
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
   325
23628
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   326
empty out testhgignore
7d7a4848fff4 test-hgignore: add testing for ui.ignore
Siddharth Agarwal <sid0@fb.com>
parents: 21815
diff changeset
   327
  $ echo > .hg/testhgignore
23629
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   328
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   329
Test relative ignore path (issue4473):
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   330
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   331
  $ cat >> $HGRCPATH << EOF
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   332
  > [ui]
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   333
  > ignore.relative = .hg/testhgignorerel
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   334
  > EOF
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   335
  $ echo "glob:*.o" > .hg/testhgignorerel
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   336
  $ cd dir
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   337
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   338
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   339
  ? .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   340
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   341
  ? syntax
42862
96ddf83fc267 tests: show the pattern generated for a relative glob
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42633
diff changeset
   342
  $ hg debugignore
42864
72890d8f9860 match: simplify the regexps created for glob patterns
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42862
diff changeset
   343
  <includematcher includes='.*\\.o(?:/|$)'>
6479
31abcae33b4f dirstate: do not ignore current directory '.' (issue 1078)
Patrick Mezard <pmezard@gmail.com>
parents: 5029
diff changeset
   344
23629
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   345
  $ cd ..
a04c7b74b3d5 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 23628
diff changeset
   346
  $ echo > .hg/testhgignorerel
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   347
  $ echo "syntax: glob" > .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   348
  $ echo "re:.*\.o" >> .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   349
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   350
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   351
  ? .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   352
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   353
  ? syntax
5029
ac97e065cfc7 Fix re: and glob: patterns in .hgignore (reported by Brad Schick)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4439
diff changeset
   354
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   355
  $ echo "syntax: invalid" > .hgignore
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12312
diff changeset
   356
  $ hg status
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35230
diff changeset
   357
  $TESTTMP/ignorerepo/.hgignore: ignoring invalid syntax 'invalid'
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   358
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   359
  ? .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   360
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   361
  ? a.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   362
  ? dir/c.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   363
  ? syntax
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
   364
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   365
  $ echo "syntax: glob" > .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   366
  $ echo "*.o" >> .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   367
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   368
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   369
  ? .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   370
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   371
  ? syntax
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
   372
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   373
  $ echo "relglob:syntax*" > .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   374
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   375
  A dir/b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   376
  ? .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   377
  ? a.c
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   378
  ? a.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   379
  ? dir/c.o
1478
e6dd91a88b57 add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
   380
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   381
  $ echo "rootglob:dir/b.o" > .hgignore
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   382
  $ hg status
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   383
  A dir/b.o
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   384
  ? .hgignore
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   385
  ? a.c
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   386
  ? a.o
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   387
  ? dir/c.o
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   388
  ? syntax
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   389
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   390
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   391
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   392
  (?:\A[a&&b])
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   393
  script::hgignore --print-re:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   394
  ^(?:dir/b\.o(?:/|$))
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   395
#endif
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   396
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   397
  $ echo "relglob:*" > .hgignore
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   398
  $ hg status
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   399
  A dir/b.o
1491
91c0e8d7ddcf fix a bug in dirstate.changes when cwd != repo.root
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1478
diff changeset
   400
12312
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   401
  $ cd dir
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   402
  $ hg status .
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   403
  A b.o
83a310f2f14a tests: unify test-hgignore
Adrian Buehlmann <adrian@cadifra.com>
parents: 6479
diff changeset
   404
13396
3e66eec9a814 add debugignore which yields the combined ignore patten of the .hgignore files
jfh <jason@jasonfharris.com>
parents: 12640
diff changeset
   405
  $ hg debugignore
42864
72890d8f9860 match: simplify the regexps created for glob patterns
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42862
diff changeset
   406
  <includematcher includes='.*(?:/|$)'>
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16487
diff changeset
   407
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   408
#if rhg
52557
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   409
  $ rhg_debugignore
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   410
  debugignorerhg:
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   411
  (?:\A(?-u:[\x00-\xFF])*?(?:/|\z))
b89c934e6269 rust-hgignore: add a scripting command to print the hgignore regexp
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52556
diff changeset
   412
  script::hgignore --print-re:
52556
1866119cbad7 rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 52354
diff changeset
   413
  ^(?:.*(?:/|$))
52354
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   414
#endif
ff19ddb256b3 rust-ignore: add some tests of `debugignorerhg`, add flag -a to control output
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49605
diff changeset
   415
27671
067d87feeb11 debugignore: find out if a file is being ignored
Laurent Charignon <lcharignon@fb.com>
parents: 27381
diff changeset
   416
  $ hg debugignore b.o
067d87feeb11 debugignore: find out if a file is being ignored
Laurent Charignon <lcharignon@fb.com>
parents: 27381
diff changeset
   417
  b.o is ignored
27757
6ff556ef5a46 test-hgignore: add globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 27672
diff changeset
   418
  (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: '*') (glob)
27671
067d87feeb11 debugignore: find out if a file is being ignored
Laurent Charignon <lcharignon@fb.com>
parents: 27381
diff changeset
   419
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16487
diff changeset
   420
  $ cd ..
19128
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   421
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   422
Check patterns that match only the directory
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   423
33214
7367b76ef75c tests: add line specific for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   424
"(fsmonitor !)" below assumes that fsmonitor is enabled with
7367b76ef75c tests: add line specific for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   425
"walk_on_invalidate = false" (default), which doesn't involve
7367b76ef75c tests: add line specific for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   426
re-walking whole repository at detection of .hgignore change.
7367b76ef75c tests: add line specific for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   427
19128
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   428
  $ echo "^dir\$" > .hgignore
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   429
  $ hg status
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   430
  A dir/b.o
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   431
  ? .hgignore
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   432
  ? a.c
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   433
  ? a.o
33214
7367b76ef75c tests: add line specific for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   434
  ? dir/c.o (fsmonitor !)
19128
f4930b533d55 hgignore: fix regression with hgignore directory matches (issue3921)
Durham Goode <durham@fb.com>
parents: 16913
diff changeset
   435
  ? syntax
21815
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   436
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   437
Check recursive glob pattern matches no directories (dir/**/c.o matches dir/c.o)
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   438
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   439
  $ echo "syntax: glob" > .hgignore
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   440
  $ echo "dir/**/c.o" >> .hgignore
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   441
  $ touch dir/c.o
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   442
  $ mkdir dir/subdir
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   443
  $ touch dir/subdir/c.o
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   444
  $ hg status
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   445
  A dir/b.o
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   446
  ? .hgignore
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   447
  ? a.c
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   448
  ? a.o
a4b67bf1f0a5 match: make glob '**/' match the empty string
Siddharth Agarwal <sid0@fb.com>
parents: 19128
diff changeset
   449
  ? syntax
27671
067d87feeb11 debugignore: find out if a file is being ignored
Laurent Charignon <lcharignon@fb.com>
parents: 27381
diff changeset
   450
  $ hg debugignore a.c
067d87feeb11 debugignore: find out if a file is being ignored
Laurent Charignon <lcharignon@fb.com>
parents: 27381
diff changeset
   451
  a.c is not ignored
067d87feeb11 debugignore: find out if a file is being ignored
Laurent Charignon <lcharignon@fb.com>
parents: 27381
diff changeset
   452
  $ hg debugignore dir/c.o
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35230
diff changeset
   453
  dir/c.o is ignored
27757
6ff556ef5a46 test-hgignore: add globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 27672
diff changeset
   454
  (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 2: 'dir/**/c.o') (glob)
25215
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   455
41282
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   456
Check rooted globs
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   457
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   458
  $ hg purge --all --config extensions.purge=
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   459
  $ echo "syntax: rootglob" > .hgignore
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   460
  $ echo "a/*.ext" >> .hgignore
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   461
  $ for p in a b/a aa; do mkdir -p $p; touch $p/b.ext; done
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   462
  $ hg status -A 'set:**.ext'
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   463
  ? aa/b.ext
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   464
  ? b/a/b.ext
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   465
  I a/b.ext
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   466
25215
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   467
Check using 'include:' in ignore file
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   468
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   469
  $ hg purge --all --config extensions.purge=
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   470
  $ touch foo.included
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   471
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   472
  $ echo ".*.included" > otherignore
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   473
  $ hg status -I "include:otherignore"
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   474
  ? foo.included
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   475
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   476
  $ echo "include:otherignore" >> .hgignore
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   477
  $ hg status
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   478
  A dir/b.o
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   479
  ? .hgignore
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   480
  ? otherignore
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   481
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   482
Check recursive uses of 'include:'
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   483
25870
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   484
  $ echo "include:nested/ignore" >> otherignore
41282
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   485
  $ mkdir nested nested/more
25870
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   486
  $ echo "glob:*ignore" > nested/ignore
41282
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   487
  $ echo "rootglob:a" >> nested/ignore
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   488
  $ touch a nested/a nested/more/a
25215
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   489
  $ hg status
4040e06e9b99 match: add 'include:' syntax
Durham Goode <durham@fb.com>
parents: 23629
diff changeset
   490
  A dir/b.o
41282
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   491
  ? nested/a
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   492
  ? nested/more/a
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   493
  $ rm a nested/a nested/more/a
25216
dc562165044a ignore: use 'include:' rules instead of custom syntax
Durham Goode <durham@fb.com>
parents: 25215
diff changeset
   494
25283
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   495
  $ cp otherignore goodignore
25216
dc562165044a ignore: use 'include:' rules instead of custom syntax
Durham Goode <durham@fb.com>
parents: 25215
diff changeset
   496
  $ echo "include:badignore" >> otherignore
dc562165044a ignore: use 'include:' rules instead of custom syntax
Durham Goode <durham@fb.com>
parents: 25215
diff changeset
   497
  $ hg status
35230
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 33507
diff changeset
   498
  skipping unreadable pattern file 'badignore': $ENOENT$
25216
dc562165044a ignore: use 'include:' rules instead of custom syntax
Durham Goode <durham@fb.com>
parents: 25215
diff changeset
   499
  A dir/b.o
25283
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   500
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   501
  $ mv goodignore otherignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   502
25870
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   503
Check using 'include:' while in a non-root directory
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   504
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   505
  $ cd ..
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   506
  $ hg -R ignorerepo status
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   507
  A dir/b.o
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   508
  $ cd ignorerepo
3de48ff62733 ignore: fix include: rules depending on current directory (issue4759)
Durham Goode <durham@fb.com>
parents: 25869
diff changeset
   509
25283
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   510
Check including subincludes
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   511
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   512
  $ hg revert -q --all
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   513
  $ hg purge --all --config extensions.purge=
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   514
  $ echo ".hgignore" > .hgignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   515
  $ mkdir dir1 dir2
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   516
  $ touch dir1/file1 dir1/file2 dir2/file1 dir2/file2
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   517
  $ echo "subinclude:dir2/.hgignore" >> .hgignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   518
  $ echo "glob:file*2" > dir2/.hgignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   519
  $ hg status
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   520
  ? dir1/file1
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   521
  ? dir1/file2
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   522
  ? dir2/file1
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   523
41282
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   524
Check including subincludes with other patterns
25283
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   525
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   526
  $ echo "subinclude:dir1/.hgignore" >> .hgignore
41282
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   527
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   528
  $ mkdir dir1/subdir
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   529
  $ touch dir1/subdir/file1
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   530
  $ echo "rootglob:f?le1" > dir1/.hgignore
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   531
  $ hg status
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   532
  ? dir1/file2
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   533
  ? dir1/subdir/file1
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   534
  ? dir2/file1
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   535
  $ rm dir1/subdir/file1
4fab8a7d2d72 match: support rooted globs in hgignore
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40782
diff changeset
   536
25283
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   537
  $ echo "regexp:f.le1" > dir1/.hgignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   538
  $ hg status
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   539
  ? dir1/file2
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   540
  ? dir2/file1
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   541
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   542
Check multiple levels of sub-ignores
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   543
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   544
  $ touch dir1/subdir/subfile1 dir1/subdir/subfile3 dir1/subdir/subfile4
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   545
  $ echo "subinclude:subdir/.hgignore" >> dir1/.hgignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   546
  $ echo "glob:subfil*3" >> dir1/subdir/.hgignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   547
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   548
  $ hg status
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   549
  ? dir1/file2
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   550
  ? dir1/subdir/subfile4
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   551
  ? dir2/file1
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   552
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   553
Check include subignore at the same level
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   554
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   555
  $ mv dir1/subdir/.hgignore dir1/.hgignoretwo
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   556
  $ echo "regexp:f.le1" > dir1/.hgignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   557
  $ echo "subinclude:.hgignoretwo" >> dir1/.hgignore
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   558
  $ echo "glob:file*2" > dir1/.hgignoretwo
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   559
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   560
  $ hg status | grep file2
19d0e5efa6ca match: enable 'subinclude:' syntax
Durham Goode <durham@fb.com>
parents: 25216
diff changeset
   561
  [1]
27671
067d87feeb11 debugignore: find out if a file is being ignored
Laurent Charignon <lcharignon@fb.com>
parents: 27381
diff changeset
   562
  $ hg debugignore dir1/file2
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35230
diff changeset
   563
  dir1/file2 is ignored
27672
f2da9bb87ae0 debugignore: find out why a file is being ignored (issue4856)
Laurent Charignon <lcharignon@fb.com>
parents: 27671
diff changeset
   564
  (ignore rule in dir2/.hgignore, line 1: 'file*2')
28054
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   565
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   566
#if windows
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   567
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   568
Windows paths are accepted on input
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   569
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   570
  $ rm dir1/.hgignore
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   571
  $ echo "dir1/file*" >> .hgignore
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   572
  $ hg debugignore "dir1\file2"
41721
eb8a8af4cbd0 tests: correct the remaining fallout from recent path style changes on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 41282
diff changeset
   573
  dir1/file2 is ignored
28054
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   574
  (ignore rule in $TESTTMP\ignorerepo\.hgignore, line 4: 'dir1/file*')
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   575
  $ hg up -qC .
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   576
8515b813976b debugignore: normalize the file before testing dirstate._ignore()
Matt Harbison <matt_harbison@yahoo.com>
parents: 27757
diff changeset
   577
#endif
47409
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   578
48223
b4f83c9e7905 dirstate-v2: Add support when Rust is not enabled
Simon Sapin <simon.sapin@octobus.net>
parents: 48068
diff changeset
   579
#if dirstate-v2 rust
47409
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   580
47674
ff97e793ed36 dirstate-v2: Introduce a docket file
Simon Sapin <simon.sapin@octobus.net>
parents: 47476
diff changeset
   581
Check the hash of ignore patterns written in the dirstate
48223
b4f83c9e7905 dirstate-v2: Add support when Rust is not enabled
Simon Sapin <simon.sapin@octobus.net>
parents: 48068
diff changeset
   582
This is an optimization that is only relevant when using the Rust extensions
47409
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   583
49558
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   584
  $ cat_filename_and_hash () {
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   585
  >     for i in "$@"; do
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   586
  >         printf "$i "
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   587
  >         cat "$i" | "$TESTDIR"/f --raw-sha1 | sed 's/^raw-sha1=//'
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   588
  >     done
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   589
  > }
47409
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   590
  $ hg status > /dev/null
49558
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   591
  $ cat_filename_and_hash .hg/testhgignore .hg/testhgignorerel .hgignore dir2/.hgignore dir1/.hgignore dir1/.hgignoretwo | $TESTDIR/f --sha1
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   592
  sha1=c0beb296395d48ced8e14f39009c4ea6e409bfe6
49152
eaaf4f98c9f1 dirstate-v2: add flag to `debugstate` to print docket information
Rapha?l Gom?s <rgomes@octobus.net>
parents: 48681
diff changeset
   593
  $ hg debugstate --docket | grep ignore
49558
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   594
  ignore pattern hash: c0beb296395d48ced8e14f39009c4ea6e409bfe6
47409
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   595
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   596
  $ echo rel > .hg/testhgignorerel
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   597
  $ hg status > /dev/null
49558
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   598
  $ cat_filename_and_hash .hg/testhgignore .hg/testhgignorerel .hgignore dir2/.hgignore dir1/.hgignore dir1/.hgignoretwo | $TESTDIR/f --sha1
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   599
  sha1=b8e63d3428ec38abc68baa27631516d5ec46b7fa
49152
eaaf4f98c9f1 dirstate-v2: add flag to `debugstate` to print docket information
Rapha?l Gom?s <rgomes@octobus.net>
parents: 48681
diff changeset
   600
  $ hg debugstate --docket | grep ignore
49558
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   601
  ignore pattern hash: b8e63d3428ec38abc68baa27631516d5ec46b7fa
49557
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   602
  $ cd ..
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   603
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   604
Check that the hash depends on the source of the hgignore patterns
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   605
(otherwise the context is lost and things like subinclude are cached improperly)
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   606
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   607
  $ hg init ignore-collision
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   608
  $ cd ignore-collision
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   609
  $ echo > .hg/testhgignorerel
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   610
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   611
  $ mkdir dir1/ dir1/subdir
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   612
  $ touch dir1/subdir/f dir1/subdir/ignored1
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   613
  $ echo 'ignored1' > dir1/.hgignore
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   614
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   615
  $ mkdir dir2 dir2/subdir
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   616
  $ touch dir2/subdir/f dir2/subdir/ignored2
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   617
  $ echo 'ignored2' > dir2/.hgignore
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   618
  $ echo 'subinclude:dir2/.hgignore' >> .hgignore
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   619
  $ echo 'subinclude:dir1/.hgignore' >> .hgignore
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   620
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   621
  $ hg commit -Aqm_
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   622
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   623
  $ > dir1/.hgignore
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   624
  $ echo 'ignored' > dir2/.hgignore
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   625
  $ echo 'ignored1' >> dir2/.hgignore
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   626
  $ hg status
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   627
  M dir1/.hgignore
ca19335e86e5 dirstate-v2: add test that shows a collision in ignore patterns hash
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49539
diff changeset
   628
  M dir2/.hgignore
49558
363923bd51cd dirstate-v2: hash the source of the ignore patterns as well
Rapha?l Gom?s <rgomes@octobus.net>
parents: 49557
diff changeset
   629
  ? dir1/subdir/ignored1
47409
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   630
0ef8231e413f dirstate-v2: Store a hash of ignore patterns (.hgignore)
Simon Sapin <simon.sapin@octobus.net>
parents: 47281
diff changeset
   631
#endif