##// 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 > evolution.exchange=True
10 > evolution.exchange=True
11 > EOF
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 initialize
18 initialize
16
19
@@ -2,7 +2,10 b''
2 $ hg init repo
2 $ hg init repo
3 $ cd repo
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 no bookmarks
10 no bookmarks
8
11
@@ -1074,8 +1077,8 b' add hooks:'
1074
1077
1075 $ cat << EOF >> .hg/hgrc
1078 $ cat << EOF >> .hg/hgrc
1076 > [hooks]
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)
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)"
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)
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 > EOF
1082 > EOF
1080
1083
1081 $ hg log -G -T phases
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 $ cat >> $HGRCPATH << EOF
5 $ cat >> $HGRCPATH << EOF
3 > [extensions]
6 > [extensions]
4 > phasereport=$TESTDIR/testlib/ext-phase-report.py
7 > phasereport=$TESTDIR/testlib/ext-phase-report.py
5 > [hooks]
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 > EOF
10 > EOF
8
11
9 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
12 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
@@ -796,7 +799,7 b' Install a hook that prevent b3325c91a4d9'
796
799
797 $ cat >> .hg/hgrc << EOF
800 $ cat >> .hg/hgrc << EOF
798 > [hooks]
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 > EOF
803 > EOF
801
804
802 Try various actions. only the draft move should succeed
805 Try various actions. only the draft move should succeed
@@ -56,12 +56,16 b' expect authorization error: must have au'
56
56
57 expect success
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 $ cat >> .hg/hgrc <<EOF
63 $ cat >> .hg/hgrc <<EOF
60 > allow_push = *
64 > allow_push = *
61 > [hooks]
65 > [hooks]
62 > changegroup = sh -c "printenv.py changegroup 0"
66 > changegroup = sh -c "printenv.py changegroup 0"
63 > pushkey = sh -c "printenv.py pushkey 0"
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 > EOF
69 > EOF
66 $ req
70 $ req
67 pushing to http://localhost:$HGPORT/
71 pushing to http://localhost:$HGPORT/
General Comments 0
You need to be logged in to leave comments. Login now