tests/test-diff-color
author Mads Kiilerich <mads@kiilerich.com>
Tue, 29 Jun 2010 12:12:34 +0200
branchstable
changeset 11488 f786fc4b8764
parent 9711 d29bd00bbc50
permissions -rwxr-xr-x
log: follow filenames through renames (issue647) In commands.log a displayer was initialized from cmdutil.show_changeset() with the initial matchfn (which designates the specified files which only is correct in the highest revision in the range). prep() is handed the correct list of files, but displayer.show() didn't use that list but keept using the original matchfn. The matchfn argument to cmdutil.show_changeset() wasn't specified in other places and is only used in .show(), so now we give the matchfn as an optional parameter to .show(). We do however still have to detect --patch and --stat from opts in show_changeset() and let it imply a matchall, but that can now be overruled with the new .show() matchfn parameter.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7458
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     2
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     3
echo "[extensions]" >> $HGRCPATH
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     4
echo "color=" >> $HGRCPATH
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     5
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     6
hg init repo
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     7
cd repo
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     8
cat > a <<EOF
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
     9
c
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    10
c
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    11
a
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    12
a
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    13
b
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    14
a
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    15
a
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    16
c
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    17
c
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    18
EOF
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    19
hg ci -Am adda
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    20
cat > a <<EOF
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    21
c
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    22
c
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    23
a
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    24
a
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    25
dd
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    26
a
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    27
a
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    28
c
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    29
c
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    30
EOF
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    31
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    32
echo '% default context'
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    33
hg diff --nodates --color=always
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    34
03dd55115985 color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
    35
echo '% --unified=2'
9579
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    36
hg diff --nodates -U 2  --color=always
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    37
9641
9b99f158348a color: colorize diff --stat
Brodie Rao <me+hg@dackz.net>
parents: 9579
diff changeset
    38
echo '% diffstat'
9b99f158348a color: colorize diff --stat
Brodie Rao <me+hg@dackz.net>
parents: 9579
diff changeset
    39
hg diff --stat --color=always
9b99f158348a color: colorize diff --stat
Brodie Rao <me+hg@dackz.net>
parents: 9579
diff changeset
    40
9579
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    41
echo "record=" >> $HGRCPATH
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    42
echo "[ui]" >> $HGRCPATH
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    43
echo "interactive=true" >> $HGRCPATH
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    44
echo "[diff]" >> $HGRCPATH
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    45
echo "git=True" >> $HGRCPATH
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    46
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    47
echo % record
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    48
chmod 0755 a
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    49
hg record --color=always -m moda a <<EOF
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    50
y
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    51
y
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    52
EOF
c06e7581bbaa color: add test for record support
Brodie Rao <me+hg@dackz.net>
parents: 7458
diff changeset
    53
echo
9711
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    54
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    55
echo "[extensions]" >> $HGRCPATH
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    56
echo "mq=" >> $HGRCPATH
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    57
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    58
hg rollback
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    59
echo % qrecord
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    60
hg qrecord --color=always -m moda patch <<EOF
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    61
y
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    62
y
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    63
EOF
d29bd00bbc50 color: wrap qrecord
Martin Geisler <mg@lazybytes.net>
parents: 9641
diff changeset
    64
echo