tests/test-copy2
author Bryan O'Sullivan <bos@serpentine.com>
Sat, 17 Sep 2005 00:27:27 -0700
changeset 1270 fc3b41570082
parent 1252 94f38724283f
child 3853 c0b449154a90
permissions -rwxr-xr-x
Switch to new syntax for .hgignore files. Here is the new syntax, in summary. Trailing white space is dropped. The escape character is "\". Comments start with #. Empty lines are skipped. Lines can be of the following formats: syntax: regexp # defaults following lines to non-rooted regexps syntax: glob # defaults following lines to non-rooted globs re:pattern # non-rooted regular expression glob:pattern # non-rooted glob pattern # pattern of the current default type The default pattern type is regexp, which is completely backwards compatible with the old hgignore syntax. In the dirstate class, the ignore method has been reworked to be based on the util.matcher function, by way of a new dirstate.hgignore method.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     1
#!/bin/sh
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     2
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     3
hg init
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     4
echo foo > foo
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     5
hg add foo
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     6
hg commit -m1 -d"0 0"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     7
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     8
echo "# should show copy"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
     9
hg copy foo bar
1168
235e0effa672 Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1127
diff changeset
    10
hg debugstate|grep '^copy'
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    11
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    12
echo "# shouldn't show copy"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    13
hg commit -m2 -d"0 0"
1168
235e0effa672 Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1127
diff changeset
    14
hg debugstate|grep '^copy'
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    15
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    16
echo "# should match"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    17
hg debugindex .hg/data/foo.i
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    18
hg debugrename bar
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    19
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    20
echo bleah > foo
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    21
echo quux > bar
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    22
hg commit -m3 -d"0 0"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    23
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    24
echo "# should not be renamed"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    25
hg debugrename bar
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    26
1249
a5355fa5e33a Fix up copy command to behave more like regular "cp".
Bryan O'Sullivan <bos@serpentine.com>
parents: 1168
diff changeset
    27
hg copy -f foo bar
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    28
echo "# should show copy"
1168
235e0effa672 Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1127
diff changeset
    29
hg debugstate|grep '^copy'
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    30
hg commit -m3 -d"0 0"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    31
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    32
echo "# should show no parents for tip"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    33
hg debugindex .hg/data/bar.i
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    34
echo "# should match"
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    35
hg debugindex .hg/data/foo.i
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    36
hg debugrename bar
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    37
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    38
echo "# should show no copies"
1168
235e0effa672 Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1127
diff changeset
    39
hg debugstate|grep '^copy'
1127
19b048da4da9 Fixed test-copy2 with only looking at copied files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1117
diff changeset
    40
19b048da4da9 Fixed test-copy2 with only looking at copied files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1117
diff changeset
    41
exit 0