Skip to content

Instantly share code, notes, and snippets.

@cointoss1973
Forked from yuja/subrepo+mq-test.sh
Created June 21, 2012 01:17
Show Gist options
  • Save cointoss1973/2963299 to your computer and use it in GitHub Desktop.
Save cointoss1973/2963299 to your computer and use it in GitHub Desktop.
Mercurial subrepository+mq+qrefresh test script
#!/bin/sh -e
HGROOT="$HOME/work/hghacks/mercurial"
HG="$HGROOT/hg"
LANG=C
TESTTMP="/tmp/subrepo+mq.d"
make -C "$HGROOT" local > /dev/null
"$HG" --version -q
repo="$(mktemp -d --tmpdir="$TESTTMP")"
"$HG" init "$repo"
"$HG" init "$repo/sub"
echo foo >> "$repo/sub/foo"
"$HG" -R "$repo/sub" ci -Am 'add foo to sub'
echo 'sub = sub' >> "$repo/.hgsub"
"$HG" -R "$repo" ci -Am 'add sub'
"$HG" -R "$repo" qnew foo.diff
echo foo >> "$repo/sub/foo"
"$HG" -R "$repo/sub" ci -Am 'append foo to sub'
for i in $(seq 1 2); do
echo '----' $i
"$HG" -R "$repo" qrefresh
cat "$repo/.hg/patches/foo.diff"
if ! "$HG" -R "$repo" status --change . | grep '\.hgsubstate'; then
echo '**** ouch!'
exit 1
fi
done
#!/bin/sh -e
HGROOT="$HOME/work/hghacks/mercurial"
HG="$HGROOT/hg"
LANG=C
TESTTMP="/tmp/subrepo+mq.d"
make -C "$HGROOT" local > /dev/null
"$HG" --version -q
repo="$(mktemp -d --tmpdir="$TESTTMP")"
"$HG" init "$repo"
"$HG" init "$repo/sub"
echo foo >> "$repo/sub/foo"
"$HG" -R "$repo/sub" ci -Am 'add foo to sub'
echo 'sub = sub' >> "$repo/.hgsub"
"$HG" -R "$repo" ci -Am 'add sub'
"$HG" -R "$repo" qnew foo.diff
echo foo >> "$repo/sub/foo"
"$HG" -R "$repo/sub" ci -Am 'append foo to sub'
for i in $(seq 1 2); do
echo '----' $i
"$HG" -R "$repo" qrefresh
cat "$repo/.hg/patches/foo.diff"
if ! "$HG" -R "$repo" status --change . | grep '\.hgsubstate'; then
echo '**** ouch!'
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment