tests/test-hgignore
branchstable
changeset 12795 3cb0559e44d0
parent 12793 469850088fc1
parent 12794 6bf8d48bec8e
child 12796 bc69ba99e34b
equal deleted inserted replaced
12793:469850088fc1 12795:3cb0559e44d0
     1 #!/bin/sh
       
     2 
       
     3 hg init
       
     4 
       
     5 # Test issue 562: .hgignore requires newline at end
       
     6 touch foo
       
     7 touch bar
       
     8 touch baz
       
     9 cat > makeignore.py <<EOF
       
    10 f = open(".hgignore", "w")
       
    11 f.write("ignore\n")
       
    12 f.write("foo\n")
       
    13 # No EOL here
       
    14 f.write("bar")
       
    15 f.close()
       
    16 EOF
       
    17 
       
    18 python makeignore.py
       
    19 echo % should display baz only
       
    20 hg status
       
    21 rm foo bar baz .hgignore makeignore.py
       
    22 
       
    23 touch a.o
       
    24 touch a.c
       
    25 touch syntax
       
    26 mkdir dir
       
    27 touch dir/a.o
       
    28 touch dir/b.o
       
    29 touch dir/c.o
       
    30 
       
    31 hg add dir/a.o
       
    32 hg commit -m 0
       
    33 hg add dir/b.o
       
    34 
       
    35 echo "--" ; hg status
       
    36 
       
    37 echo "*.o" > .hgignore
       
    38 echo "--" ; hg status 2>&1 | sed -e 's/abort: .*\.hgignore:/abort: .hgignore:/'
       
    39 
       
    40 echo ".*\.o" > .hgignore
       
    41 echo "--" ; hg status
       
    42 
       
    43 # Check it does not ignore the current directory '.'
       
    44 echo "^\." > .hgignore
       
    45 echo "--" ; hg status
       
    46 
       
    47 echo "glob:**.o" > .hgignore
       
    48 echo "--" ; hg status
       
    49 
       
    50 echo "glob:*.o" > .hgignore
       
    51 echo "--" ; hg status
       
    52 
       
    53 echo "syntax: glob" > .hgignore
       
    54 echo "re:.*\.o" >> .hgignore
       
    55 echo "--" ; hg status
       
    56 
       
    57 echo "syntax: invalid" > .hgignore
       
    58 echo "--" ; hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/'
       
    59 
       
    60 echo "syntax: glob" > .hgignore
       
    61 echo "*.o" >> .hgignore
       
    62 echo "--" ; hg status
       
    63 
       
    64 echo "relglob:syntax*" > .hgignore
       
    65 echo "--" ; hg status
       
    66 
       
    67 echo "relglob:*" > .hgignore
       
    68 echo "--" ; hg status
       
    69 
       
    70 cd dir
       
    71 echo "--" ; hg status .