Source

mercurial/extensions/rdiff / test-rdiff

Full commit
#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "rdiff=" >> $HGRCPATH

hg init base
cd base
echo foo > foo
hg ci -Amfoo

hg clone . ../b1
cd ../b1
echo bar >> foo
echo % working directory diff
hg diff --git --reverse ../base
hg ci -mbar
hg diff --git ../base

cd ../base
hg diff --git ../b1
echo '% remote revision'
hg diff --git -r . -r tip ../b1

mkdir d1
echo foo > d1/foo
hg ci -Amb2
echo % cross-branch diff
hg diff --git ../b1

echo % pattern matching
hg diff --git ../b1 d1