##// END OF EJS Templates
test-pushvars: invoke shell script hook via `sh` for Windows...
Matt Harbison -
r33793:4f8c241b default
parent child Browse files
Show More
@@ -1,71 +1,70 b''
1 Setup
1 Setup
2
2
3 $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
3 $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
4 $ export PYTHONPATH
4 $ export PYTHONPATH
5
5
6 $ cat > $TESTTMP/pretxnchangegroup.sh << EOF
6 $ cat > $TESTTMP/pretxnchangegroup.sh << EOF
7 > #!/bin/sh
7 > #!/bin/sh
8 > env | egrep "^HG_USERVAR_(DEBUG|BYPASS_REVIEW)" | sort
8 > env | egrep "^HG_USERVAR_(DEBUG|BYPASS_REVIEW)" | sort
9 > exit 0
9 > exit 0
10 > EOF
10 > EOF
11 $ chmod +x $TESTTMP/pretxnchangegroup.sh
12 $ cat >> $HGRCPATH << EOF
11 $ cat >> $HGRCPATH << EOF
13 > [hooks]
12 > [hooks]
14 > pretxnchangegroup = $TESTTMP/pretxnchangegroup.sh
13 > pretxnchangegroup = sh $TESTTMP/pretxnchangegroup.sh
15 > [experimental]
14 > [experimental]
16 > bundle2-exp = true
15 > bundle2-exp = true
17 > EOF
16 > EOF
18
17
19 $ hg init repo
18 $ hg init repo
20 $ hg clone -q repo child
19 $ hg clone -q repo child
21 $ cd child
20 $ cd child
22
21
23 Test pushing vars to repo with pushvars.server not set
22 Test pushing vars to repo with pushvars.server not set
24
23
25 $ echo b > a
24 $ echo b > a
26 $ hg commit -Aqm a
25 $ hg commit -Aqm a
27 $ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
26 $ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
28 pushing to $TESTTMP/repo (glob)
27 pushing to $TESTTMP/repo (glob)
29 searching for changes
28 searching for changes
30 adding changesets
29 adding changesets
31 adding manifests
30 adding manifests
32 adding file changes
31 adding file changes
33 added 1 changesets with 1 changes to 1 files
32 added 1 changesets with 1 changes to 1 files
34
33
35 Setting pushvars.sever = true and then pushing.
34 Setting pushvars.sever = true and then pushing.
36
35
37 $ echo [push] >> $HGRCPATH
36 $ echo [push] >> $HGRCPATH
38 $ echo "pushvars.server = true" >> $HGRCPATH
37 $ echo "pushvars.server = true" >> $HGRCPATH
39 $ echo b >> a
38 $ echo b >> a
40 $ hg commit -Aqm a
39 $ hg commit -Aqm a
41 $ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
40 $ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
42 pushing to $TESTTMP/repo (glob)
41 pushing to $TESTTMP/repo (glob)
43 searching for changes
42 searching for changes
44 adding changesets
43 adding changesets
45 adding manifests
44 adding manifests
46 adding file changes
45 adding file changes
47 added 1 changesets with 1 changes to 1 files
46 added 1 changesets with 1 changes to 1 files
48 HG_USERVAR_BYPASS_REVIEW=true
47 HG_USERVAR_BYPASS_REVIEW=true
49 HG_USERVAR_DEBUG=1
48 HG_USERVAR_DEBUG=1
50
49
51 Test pushing var with empty right-hand side
50 Test pushing var with empty right-hand side
52
51
53 $ echo b >> a
52 $ echo b >> a
54 $ hg commit -Aqm a
53 $ hg commit -Aqm a
55 $ hg push --pushvars "DEBUG="
54 $ hg push --pushvars "DEBUG="
56 pushing to $TESTTMP/repo (glob)
55 pushing to $TESTTMP/repo (glob)
57 searching for changes
56 searching for changes
58 adding changesets
57 adding changesets
59 adding manifests
58 adding manifests
60 adding file changes
59 adding file changes
61 added 1 changesets with 1 changes to 1 files
60 added 1 changesets with 1 changes to 1 files
62 HG_USERVAR_DEBUG=
61 HG_USERVAR_DEBUG=
63
62
64 Test pushing bad vars
63 Test pushing bad vars
65
64
66 $ echo b >> a
65 $ echo b >> a
67 $ hg commit -Aqm b
66 $ hg commit -Aqm b
68 $ hg push --pushvars "DEBUG"
67 $ hg push --pushvars "DEBUG"
69 pushing to $TESTTMP/repo (glob)
68 pushing to $TESTTMP/repo (glob)
70 abort: unable to parse variable 'DEBUG', should follow 'KEY=VALUE' or 'KEY=' format
69 abort: unable to parse variable 'DEBUG', should follow 'KEY=VALUE' or 'KEY=' format
71 [255]
70 [255]
General Comments 0
You need to be logged in to leave comments. Login now