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.
#!/bin/sh
hg init repo
cd repo
i=0; while (( $i < 213 )); do echo a >> a; i=$(($i + 1)); done
hg add a
echo '% wide diffstat'
hg diff --stat
echo '% diffstat width'
COLUMNS=24 hg diff --config ui.interactive=true --stat
hg ci -m adda
cat >> a <<EOF
a
a
a
EOF
echo '% narrow diffstat'
hg diff --stat
hg ci -m appenda
printf '%b' '\x00' > b
hg add b
echo '% binary diffstat'
hg diff --stat