-
-
Save cointoss1973/2963299 to your computer and use it in GitHub Desktop.
Mercurial subrepository+mq+qrefresh test script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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