tests/test-diffstat
author Brodie Rao <me+hg@dackz.net>
Sun, 25 Oct 2009 02:52:35 +0200
changeset 9640 9e76232fbfbe
child 9642 7d17794f08a9
permissions -rwxr-xr-x
diff: add --stat for diffstat output diff/qdiff --stat invokes patch.diffstat() on the diff output. When in interactive mode, the output's maximum width is determined by the terminal's width.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9640
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     1
#!/bin/sh
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     2
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     3
hg init repo
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     4
cd repo
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     5
i=0; while (( $i < 213 )); do echo a >> a; i=$(($i + 1)); done
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     6
hg add a
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     7
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     8
echo '% wide diffstat'
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
     9
hg diff --stat
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    10
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    11
echo '% diffstat width'
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    12
COLUMNS=24 hg diff --config ui.interactive=true --stat
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    13
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    14
hg ci -m adda
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    15
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    16
cat >> a <<EOF
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    17
a
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    18
a
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    19
a
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    20
EOF
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    21
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    22
echo '% narrow diffstat'
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    23
hg diff --stat
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    24
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    25
hg ci -m appenda
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    26
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    27
printf '%b' '\x00' > b
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    28
hg add b
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    29
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    30
echo '% binary diffstat'
9e76232fbfbe diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff changeset
    31
hg diff --stat