##// END OF EJS Templates
tests: adjust hooks for Windows...
Matt Harbison -
r34939:aa05b959 stable
parent child Browse files
Show More
@@ -10,7 +10,10 b''
10 10 > evolution.exchange=True
11 11 > EOF
12 12
13 $ TESTHOOK='hooks.txnclose-bookmark.test=echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE"'
13 $ cat > $TESTTMP/hook.sh <<'EOF'
14 > echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE"
15 > EOF
16 $ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh"
14 17
15 18 initialize
16 19
@@ -2,7 +2,10 b''
2 2 $ hg init repo
3 3 $ cd repo
4 4
5 $ TESTHOOK='hooks.txnclose-bookmark.test=echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE"'
5 $ cat > $TESTTMP/hook.sh <<'EOF'
6 > echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE"
7 > EOF
8 $ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh"
6 9
7 10 no bookmarks
8 11
@@ -1074,8 +1077,8 b' add hooks:'
1074 1077
1075 1078 $ cat << EOF >> .hg/hgrc
1076 1079 > [hooks]
1077 > pretxnclose-bookmark.force-public = (echo \$HG_BOOKMARK| grep -v NEW > /dev/null) || [ -z "\$HG_NODE" ] || (hg log -r "\$HG_NODE" -T '{phase}' | grep public > /dev/null)
1078 > pretxnclose-bookmark.force-forward = (echo \$HG_BOOKMARK| grep -v NEW > /dev/null) || [ -z "\$HG_NODE" ] || (hg log -r "max(\$HG_OLDNODE::\$HG_NODE)" -T 'MATCH' | grep MATCH > /dev/null)
1080 > pretxnclose-bookmark.force-public = sh -c "(echo \$HG_BOOKMARK| grep -v NEW > /dev/null) || [ -z \"\$HG_NODE\" ] || (hg log -r \"\$HG_NODE\" -T '{phase}' | grep public > /dev/null)"
1081 > pretxnclose-bookmark.force-forward = sh -c "(echo \$HG_BOOKMARK| grep -v NEW > /dev/null) || [ -z \"\$HG_NODE\" ] || (hg log -r \"max(\$HG_OLDNODE::\$HG_NODE)\" -T 'MATCH' | grep MATCH > /dev/null)"
1079 1082 > EOF
1080 1083
1081 1084 $ hg log -G -T phases
@@ -1,9 +1,12 b''
1 $ cat > $TESTTMP/hook.sh << 'EOF'
2 > echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE"
3 > EOF
1 4
2 5 $ cat >> $HGRCPATH << EOF
3 6 > [extensions]
4 7 > phasereport=$TESTDIR/testlib/ext-phase-report.py
5 8 > [hooks]
6 > txnclose-phase.test = echo "test-hook-close-phase: \$HG_NODE: \$HG_OLDPHASE -> \$HG_PHASE"
9 > txnclose-phase.test = sh $TESTTMP/hook.sh
7 10 > EOF
8 11
9 12 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
@@ -796,7 +799,7 b' Install a hook that prevent b3325c91a4d9'
796 799
797 800 $ cat >> .hg/hgrc << EOF
798 801 > [hooks]
799 > pretxnclose-phase.nopublish_D = (echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]
802 > pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]"
800 803 > EOF
801 804
802 805 Try various actions. only the draft move should succeed
@@ -56,12 +56,16 b' expect authorization error: must have au'
56 56
57 57 expect success
58 58
59 $ cat > $TESTTMP/hook.sh <<'EOF'
60 > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE"
61 > EOF
62
59 63 $ cat >> .hg/hgrc <<EOF
60 64 > allow_push = *
61 65 > [hooks]
62 66 > changegroup = sh -c "printenv.py changegroup 0"
63 67 > pushkey = sh -c "printenv.py pushkey 0"
64 > txnclose-phase.test = echo "phase-move: \$HG_NODE: \$HG_OLDPHASE -> \$HG_PHASE"
68 > txnclose-phase.test = sh $TESTTMP/hook.sh
65 69 > EOF
66 70 $ req
67 71 pushing to http://localhost:$HGPORT/
General Comments 0
You need to be logged in to leave comments. Login now