Show More
This diff has been collapsed as it changes many lines, (653 lines changed) Show them Hide them | |||||
@@ -14,32 +14,63 commit hooks can see env vars | |||||
14 | $ cd a |
|
14 | $ cd a | |
15 | $ cat > .hg/hgrc <<EOF |
|
15 | $ cat > .hg/hgrc <<EOF | |
16 | > [hooks] |
|
16 | > [hooks] | |
17 | > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py commit" |
|
17 | > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py --line commit" | |
18 | > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py commit.b" |
|
18 | > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py --line commit.b" | |
19 | > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit" |
|
19 | > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py --line precommit" | |
20 | > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit" |
|
20 | > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxncommit" | |
21 | > pretxncommit.tip = hg -q tip |
|
21 | > pretxncommit.tip = hg -q tip | |
22 | > pre-identify = sh -c "printenv.py pre-identify 1" |
|
22 | > pre-identify = sh -c "printenv.py --line pre-identify 1" | |
23 | > pre-cat = sh -c "printenv.py pre-cat" |
|
23 | > pre-cat = sh -c "printenv.py --line pre-cat" | |
24 | > post-cat = sh -c "printenv.py post-cat" |
|
24 | > post-cat = sh -c "printenv.py --line post-cat" | |
25 | > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen" |
|
25 | > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxnopen" | |
26 | > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose" |
|
26 | > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxnclose" | |
27 | > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose" |
|
27 | > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnclose" | |
28 | > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs |
|
28 | > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs | |
29 | > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort" |
|
29 | > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnabort" | |
30 | > txnclose.checklock = sh -c "hg debuglock > /dev/null" |
|
30 | > txnclose.checklock = sh -c "hg debuglock > /dev/null" | |
31 | > EOF |
|
31 | > EOF | |
32 | $ echo a > a |
|
32 | $ echo a > a | |
33 | $ hg add a |
|
33 | $ hg add a | |
34 | $ hg commit -m a |
|
34 | $ hg commit -m a | |
35 | precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=0000000000000000000000000000000000000000 |
|
35 | precommit hook: HG_HOOKNAME=precommit | |
36 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
36 | HG_HOOKTYPE=precommit | |
37 | pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a |
|
37 | HG_PARENT1=0000000000000000000000000000000000000000 | |
|
38 | ||||
|
39 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |||
|
40 | HG_HOOKTYPE=pretxnopen | |||
|
41 | HG_TXNID=TXN:$ID$ | |||
|
42 | HG_TXNNAME=commit | |||
|
43 | ||||
|
44 | pretxncommit hook: HG_HOOKNAME=pretxncommit | |||
|
45 | HG_HOOKTYPE=pretxncommit | |||
|
46 | HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
47 | HG_PARENT1=0000000000000000000000000000000000000000 | |||
|
48 | HG_PENDING=$TESTTMP/a | |||
|
49 | ||||
38 | 0:cb9a9f314b8b |
|
50 | 0:cb9a9f314b8b | |
39 | pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
51 | pretxnclose hook: HG_HOOKNAME=pretxnclose | |
40 | txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
52 | HG_HOOKTYPE=pretxnclose | |
41 | commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 |
|
53 | HG_PENDING=$TESTTMP/a | |
42 | commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 |
|
54 | HG_PHASES_MOVED=1 | |
|
55 | HG_TXNID=TXN:$ID$ | |||
|
56 | HG_TXNNAME=commit | |||
|
57 | ||||
|
58 | txnclose hook: HG_HOOKNAME=txnclose | |||
|
59 | HG_HOOKTYPE=txnclose | |||
|
60 | HG_PHASES_MOVED=1 | |||
|
61 | HG_TXNID=TXN:$ID$ | |||
|
62 | HG_TXNNAME=commit | |||
|
63 | ||||
|
64 | commit hook: HG_HOOKNAME=commit | |||
|
65 | HG_HOOKTYPE=commit | |||
|
66 | HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
67 | HG_PARENT1=0000000000000000000000000000000000000000 | |||
|
68 | ||||
|
69 | commit.b hook: HG_HOOKNAME=commit.b | |||
|
70 | HG_HOOKTYPE=commit | |||
|
71 | HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
72 | HG_PARENT1=0000000000000000000000000000000000000000 | |||
|
73 | ||||
43 |
|
74 | |||
44 | $ hg clone . ../b |
|
75 | $ hg clone . ../b | |
45 | updating to branch default |
|
76 | updating to branch default | |
@@ -50,9 +81,9 changegroup hooks can see env vars | |||||
50 |
|
81 | |||
51 | $ cat > .hg/hgrc <<EOF |
|
82 | $ cat > .hg/hgrc <<EOF | |
52 | > [hooks] |
|
83 | > [hooks] | |
53 | > prechangegroup = sh -c "printenv.py prechangegroup" |
|
84 | > prechangegroup = sh -c "printenv.py --line prechangegroup" | |
54 | > changegroup = sh -c "printenv.py changegroup" |
|
85 | > changegroup = sh -c "printenv.py --line changegroup" | |
55 | > incoming = sh -c "printenv.py incoming" |
|
86 | > incoming = sh -c "printenv.py --line incoming" | |
56 | > EOF |
|
87 | > EOF | |
57 |
|
88 | |||
58 | pretxncommit and commit hooks can see both parents of merge |
|
89 | pretxncommit and commit hooks can see both parents of merge | |
@@ -60,103 +91,309 pretxncommit and commit hooks can see bo | |||||
60 | $ cd ../a |
|
91 | $ cd ../a | |
61 | $ echo b >> a |
|
92 | $ echo b >> a | |
62 | $ hg commit -m a1 -d "1 0" |
|
93 | $ hg commit -m a1 -d "1 0" | |
63 | precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
94 | precommit hook: HG_HOOKNAME=precommit | |
64 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
95 | HG_HOOKTYPE=precommit | |
65 | pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a |
|
96 | HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
|
97 | ||||
|
98 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |||
|
99 | HG_HOOKTYPE=pretxnopen | |||
|
100 | HG_TXNID=TXN:$ID$ | |||
|
101 | HG_TXNNAME=commit | |||
|
102 | ||||
|
103 | pretxncommit hook: HG_HOOKNAME=pretxncommit | |||
|
104 | HG_HOOKTYPE=pretxncommit | |||
|
105 | HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd | |||
|
106 | HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
107 | HG_PENDING=$TESTTMP/a | |||
|
108 | ||||
66 | 1:ab228980c14d |
|
109 | 1:ab228980c14d | |
67 | pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
110 | pretxnclose hook: HG_HOOKNAME=pretxnclose | |
68 | txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
111 | HG_HOOKTYPE=pretxnclose | |
69 | commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
112 | HG_PENDING=$TESTTMP/a | |
70 | commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
113 | HG_TXNID=TXN:$ID$ | |
|
114 | HG_TXNNAME=commit | |||
|
115 | ||||
|
116 | txnclose hook: HG_HOOKNAME=txnclose | |||
|
117 | HG_HOOKTYPE=txnclose | |||
|
118 | HG_TXNID=TXN:$ID$ | |||
|
119 | HG_TXNNAME=commit | |||
|
120 | ||||
|
121 | commit hook: HG_HOOKNAME=commit | |||
|
122 | HG_HOOKTYPE=commit | |||
|
123 | HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd | |||
|
124 | HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
125 | ||||
|
126 | commit.b hook: HG_HOOKNAME=commit.b | |||
|
127 | HG_HOOKTYPE=commit | |||
|
128 | HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd | |||
|
129 | HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
130 | ||||
71 | $ hg update -C 0 |
|
131 | $ hg update -C 0 | |
72 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
132 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
73 | $ echo b > b |
|
133 | $ echo b > b | |
74 | $ hg add b |
|
134 | $ hg add b | |
75 | $ hg commit -m b -d '1 0' |
|
135 | $ hg commit -m b -d '1 0' | |
76 | precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
136 | precommit hook: HG_HOOKNAME=precommit | |
77 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
137 | HG_HOOKTYPE=precommit | |
78 | pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a |
|
138 | HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
|
139 | ||||
|
140 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |||
|
141 | HG_HOOKTYPE=pretxnopen | |||
|
142 | HG_TXNID=TXN:$ID$ | |||
|
143 | HG_TXNNAME=commit | |||
|
144 | ||||
|
145 | pretxncommit hook: HG_HOOKNAME=pretxncommit | |||
|
146 | HG_HOOKTYPE=pretxncommit | |||
|
147 | HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 | |||
|
148 | HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
149 | HG_PENDING=$TESTTMP/a | |||
|
150 | ||||
79 | 2:ee9deb46ab31 |
|
151 | 2:ee9deb46ab31 | |
80 | pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
152 | pretxnclose hook: HG_HOOKNAME=pretxnclose | |
|
153 | HG_HOOKTYPE=pretxnclose | |||
|
154 | HG_PENDING=$TESTTMP/a | |||
|
155 | HG_TXNID=TXN:$ID$ | |||
|
156 | HG_TXNNAME=commit | |||
|
157 | ||||
81 | created new head |
|
158 | created new head | |
82 | txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
159 | txnclose hook: HG_HOOKNAME=txnclose | |
83 | commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
160 | HG_HOOKTYPE=txnclose | |
84 | commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
161 | HG_TXNID=TXN:$ID$ | |
|
162 | HG_TXNNAME=commit | |||
|
163 | ||||
|
164 | commit hook: HG_HOOKNAME=commit | |||
|
165 | HG_HOOKTYPE=commit | |||
|
166 | HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 | |||
|
167 | HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
168 | ||||
|
169 | commit.b hook: HG_HOOKNAME=commit.b | |||
|
170 | HG_HOOKTYPE=commit | |||
|
171 | HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 | |||
|
172 | HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
173 | ||||
85 | $ hg merge 1 |
|
174 | $ hg merge 1 | |
86 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
175 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
87 | (branch merge, don't forget to commit) |
|
176 | (branch merge, don't forget to commit) | |
88 | $ hg commit -m merge -d '2 0' |
|
177 | $ hg commit -m merge -d '2 0' | |
89 | precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
|
178 | precommit hook: HG_HOOKNAME=precommit | |
90 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
179 | HG_HOOKTYPE=precommit | |
91 | pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a |
|
180 | HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 | |
|
181 | HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | |||
|
182 | ||||
|
183 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |||
|
184 | HG_HOOKTYPE=pretxnopen | |||
|
185 | HG_TXNID=TXN:$ID$ | |||
|
186 | HG_TXNNAME=commit | |||
|
187 | ||||
|
188 | pretxncommit hook: HG_HOOKNAME=pretxncommit | |||
|
189 | HG_HOOKTYPE=pretxncommit | |||
|
190 | HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
191 | HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 | |||
|
192 | HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | |||
|
193 | HG_PENDING=$TESTTMP/a | |||
|
194 | ||||
92 | 3:07f3376c1e65 |
|
195 | 3:07f3376c1e65 | |
93 | pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
196 | pretxnclose hook: HG_HOOKNAME=pretxnclose | |
94 | txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
197 | HG_HOOKTYPE=pretxnclose | |
95 | commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
|
198 | HG_PENDING=$TESTTMP/a | |
96 | commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
|
199 | HG_TXNID=TXN:$ID$ | |
|
200 | HG_TXNNAME=commit | |||
|
201 | ||||
|
202 | txnclose hook: HG_HOOKNAME=txnclose | |||
|
203 | HG_HOOKTYPE=txnclose | |||
|
204 | HG_TXNID=TXN:$ID$ | |||
|
205 | HG_TXNNAME=commit | |||
|
206 | ||||
|
207 | commit hook: HG_HOOKNAME=commit | |||
|
208 | HG_HOOKTYPE=commit | |||
|
209 | HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
210 | HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 | |||
|
211 | HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | |||
|
212 | ||||
|
213 | commit.b hook: HG_HOOKNAME=commit.b | |||
|
214 | HG_HOOKTYPE=commit | |||
|
215 | HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
216 | HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 | |||
|
217 | HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | |||
|
218 | ||||
97 |
|
219 | |||
98 | test generic hooks |
|
220 | test generic hooks | |
99 |
|
221 | |||
100 | $ hg id |
|
222 | $ hg id | |
101 | pre-identify hook: HG_ARGS=id HG_HOOKNAME=pre-identify HG_HOOKTYPE=pre-identify HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None, 'template': ''} HG_PATS=[] |
|
223 | pre-identify hook: HG_ARGS=id | |
|
224 | HG_HOOKNAME=pre-identify | |||
|
225 | HG_HOOKTYPE=pre-identify | |||
|
226 | HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None, 'template': ''} | |||
|
227 | HG_PATS=[] | |||
|
228 | ||||
102 | abort: pre-identify hook exited with status 1 |
|
229 | abort: pre-identify hook exited with status 1 | |
103 | [255] |
|
230 | [255] | |
104 | $ hg cat b |
|
231 | $ hg cat b | |
105 | pre-cat hook: HG_ARGS=cat b HG_HOOKNAME=pre-cat HG_HOOKTYPE=pre-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} HG_PATS=['b'] |
|
232 | pre-cat hook: HG_ARGS=cat b | |
|
233 | HG_HOOKNAME=pre-cat | |||
|
234 | HG_HOOKTYPE=pre-cat | |||
|
235 | HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} | |||
|
236 | HG_PATS=['b'] | |||
|
237 | ||||
106 | b |
|
238 | b | |
107 | post-cat hook: HG_ARGS=cat b HG_HOOKNAME=post-cat HG_HOOKTYPE=post-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} HG_PATS=['b'] HG_RESULT=0 |
|
239 | post-cat hook: HG_ARGS=cat b | |
|
240 | HG_HOOKNAME=post-cat | |||
|
241 | HG_HOOKTYPE=post-cat | |||
|
242 | HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} | |||
|
243 | HG_PATS=['b'] | |||
|
244 | HG_RESULT=0 | |||
|
245 | ||||
108 |
|
246 | |||
109 | $ cd ../b |
|
247 | $ cd ../b | |
110 | $ hg pull ../a |
|
248 | $ hg pull ../a | |
111 | pulling from ../a |
|
249 | pulling from ../a | |
112 | searching for changes |
|
250 | searching for changes | |
113 | prechangegroup hook: HG_HOOKNAME=prechangegroup HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
251 | prechangegroup hook: HG_HOOKNAME=prechangegroup | |
|
252 | HG_HOOKTYPE=prechangegroup | |||
|
253 | HG_SOURCE=pull | |||
|
254 | HG_TXNID=TXN:$ID$ | |||
|
255 | HG_URL=file:$TESTTMP/a | |||
|
256 | ||||
114 | adding changesets |
|
257 | adding changesets | |
115 | adding manifests |
|
258 | adding manifests | |
116 | adding file changes |
|
259 | adding file changes | |
117 | added 3 changesets with 2 changes to 2 files |
|
260 | added 3 changesets with 2 changes to 2 files | |
118 | new changesets ab228980c14d:07f3376c1e65 |
|
261 | new changesets ab228980c14d:07f3376c1e65 | |
119 | changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
262 | changegroup hook: HG_HOOKNAME=changegroup | |
120 | incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
263 | HG_HOOKTYPE=changegroup | |
121 | incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
264 | HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd | |
122 | incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
265 | HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2 | |
|
266 | HG_SOURCE=pull | |||
|
267 | HG_TXNID=TXN:$ID$ | |||
|
268 | HG_URL=file:$TESTTMP/a | |||
|
269 | ||||
|
270 | incoming hook: HG_HOOKNAME=incoming | |||
|
271 | HG_HOOKTYPE=incoming | |||
|
272 | HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd | |||
|
273 | HG_SOURCE=pull | |||
|
274 | HG_TXNID=TXN:$ID$ | |||
|
275 | HG_URL=file:$TESTTMP/a | |||
|
276 | ||||
|
277 | incoming hook: HG_HOOKNAME=incoming | |||
|
278 | HG_HOOKTYPE=incoming | |||
|
279 | HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 | |||
|
280 | HG_SOURCE=pull | |||
|
281 | HG_TXNID=TXN:$ID$ | |||
|
282 | HG_URL=file:$TESTTMP/a | |||
|
283 | ||||
|
284 | incoming hook: HG_HOOKNAME=incoming | |||
|
285 | HG_HOOKTYPE=incoming | |||
|
286 | HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
287 | HG_SOURCE=pull | |||
|
288 | HG_TXNID=TXN:$ID$ | |||
|
289 | HG_URL=file:$TESTTMP/a | |||
|
290 | ||||
123 | (run 'hg update' to get a working copy) |
|
291 | (run 'hg update' to get a working copy) | |
124 |
|
292 | |||
125 | tag hooks can see env vars |
|
293 | tag hooks can see env vars | |
126 |
|
294 | |||
127 | $ cd ../a |
|
295 | $ cd ../a | |
128 | $ cat >> .hg/hgrc <<EOF |
|
296 | $ cat >> .hg/hgrc <<EOF | |
129 | > pretag = sh -c "printenv.py pretag" |
|
297 | > pretag = sh -c "printenv.py --line pretag" | |
130 | > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag" |
|
298 | > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py --line tag" | |
131 | > EOF |
|
299 | > EOF | |
132 | $ hg tag -d '3 0' a |
|
300 | $ hg tag -d '3 0' a | |
133 | pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a |
|
301 | pretag hook: HG_HOOKNAME=pretag | |
134 | precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
|
302 | HG_HOOKTYPE=pretag | |
135 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
303 | HG_LOCAL=0 | |
136 | pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a |
|
304 | HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 | |
|
305 | HG_TAG=a | |||
|
306 | ||||
|
307 | precommit hook: HG_HOOKNAME=precommit | |||
|
308 | HG_HOOKTYPE=precommit | |||
|
309 | HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
310 | ||||
|
311 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |||
|
312 | HG_HOOKTYPE=pretxnopen | |||
|
313 | HG_TXNID=TXN:$ID$ | |||
|
314 | HG_TXNNAME=commit | |||
|
315 | ||||
|
316 | pretxncommit hook: HG_HOOKNAME=pretxncommit | |||
|
317 | HG_HOOKTYPE=pretxncommit | |||
|
318 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
319 | HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
320 | HG_PENDING=$TESTTMP/a | |||
|
321 | ||||
137 | 4:539e4b31b6dc |
|
322 | 4:539e4b31b6dc | |
138 | pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
323 | pretxnclose hook: HG_HOOKNAME=pretxnclose | |
139 | tag hook: HG_HOOKNAME=tag HG_HOOKTYPE=tag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a |
|
324 | HG_HOOKTYPE=pretxnclose | |
140 | txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
325 | HG_PENDING=$TESTTMP/a | |
141 | commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
|
326 | HG_TXNID=TXN:$ID$ | |
142 | commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
|
327 | HG_TXNNAME=commit | |
|
328 | ||||
|
329 | tag hook: HG_HOOKNAME=tag | |||
|
330 | HG_HOOKTYPE=tag | |||
|
331 | HG_LOCAL=0 | |||
|
332 | HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
333 | HG_TAG=a | |||
|
334 | ||||
|
335 | txnclose hook: HG_HOOKNAME=txnclose | |||
|
336 | HG_HOOKTYPE=txnclose | |||
|
337 | HG_TXNID=TXN:$ID$ | |||
|
338 | HG_TXNNAME=commit | |||
|
339 | ||||
|
340 | commit hook: HG_HOOKNAME=commit | |||
|
341 | HG_HOOKTYPE=commit | |||
|
342 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
343 | HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
344 | ||||
|
345 | commit.b hook: HG_HOOKNAME=commit.b | |||
|
346 | HG_HOOKTYPE=commit | |||
|
347 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
348 | HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | |||
|
349 | ||||
143 | $ hg tag -l la |
|
350 | $ hg tag -l la | |
144 | pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la |
|
351 | pretag hook: HG_HOOKNAME=pretag | |
145 | tag hook: HG_HOOKNAME=tag HG_HOOKTYPE=tag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la |
|
352 | HG_HOOKTYPE=pretag | |
|
353 | HG_LOCAL=1 | |||
|
354 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
355 | HG_TAG=la | |||
|
356 | ||||
|
357 | tag hook: HG_HOOKNAME=tag | |||
|
358 | HG_HOOKTYPE=tag | |||
|
359 | HG_LOCAL=1 | |||
|
360 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
361 | HG_TAG=la | |||
|
362 | ||||
146 |
|
363 | |||
147 | pretag hook can forbid tagging |
|
364 | pretag hook can forbid tagging | |
148 |
|
365 | |||
149 | $ cat >> .hg/hgrc <<EOF |
|
366 | $ cat >> .hg/hgrc <<EOF | |
150 | > pretag.forbid = sh -c "printenv.py pretag.forbid 1" |
|
367 | > pretag.forbid = sh -c "printenv.py --line pretag.forbid 1" | |
151 | > EOF |
|
368 | > EOF | |
152 | $ hg tag -d '4 0' fa |
|
369 | $ hg tag -d '4 0' fa | |
153 | pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa |
|
370 | pretag hook: HG_HOOKNAME=pretag | |
154 | pretag.forbid hook: HG_HOOKNAME=pretag.forbid HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa |
|
371 | HG_HOOKTYPE=pretag | |
|
372 | HG_LOCAL=0 | |||
|
373 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
374 | HG_TAG=fa | |||
|
375 | ||||
|
376 | pretag.forbid hook: HG_HOOKNAME=pretag.forbid | |||
|
377 | HG_HOOKTYPE=pretag | |||
|
378 | HG_LOCAL=0 | |||
|
379 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
380 | HG_TAG=fa | |||
|
381 | ||||
155 | abort: pretag.forbid hook exited with status 1 |
|
382 | abort: pretag.forbid hook exited with status 1 | |
156 | [255] |
|
383 | [255] | |
157 | $ hg tag -l fla |
|
384 | $ hg tag -l fla | |
158 | pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla |
|
385 | pretag hook: HG_HOOKNAME=pretag | |
159 | pretag.forbid hook: HG_HOOKNAME=pretag.forbid HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla |
|
386 | HG_HOOKTYPE=pretag | |
|
387 | HG_LOCAL=1 | |||
|
388 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
389 | HG_TAG=fla | |||
|
390 | ||||
|
391 | pretag.forbid hook: HG_HOOKNAME=pretag.forbid | |||
|
392 | HG_HOOKTYPE=pretag | |||
|
393 | HG_LOCAL=1 | |||
|
394 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
395 | HG_TAG=fla | |||
|
396 | ||||
160 | abort: pretag.forbid hook exited with status 1 |
|
397 | abort: pretag.forbid hook exited with status 1 | |
161 | [255] |
|
398 | [255] | |
162 |
|
399 | |||
@@ -165,22 +402,43 more there after | |||||
165 |
|
402 | |||
166 | $ cat >> .hg/hgrc <<EOF |
|
403 | $ cat >> .hg/hgrc <<EOF | |
167 | > pretxncommit.forbid0 = sh -c "hg tip -q" |
|
404 | > pretxncommit.forbid0 = sh -c "hg tip -q" | |
168 | > pretxncommit.forbid1 = sh -c "printenv.py pretxncommit.forbid 1" |
|
405 | > pretxncommit.forbid1 = sh -c "printenv.py --line pretxncommit.forbid 1" | |
169 | > EOF |
|
406 | > EOF | |
170 | $ echo z > z |
|
407 | $ echo z > z | |
171 | $ hg add z |
|
408 | $ hg add z | |
172 | $ hg -q tip |
|
409 | $ hg -q tip | |
173 | 4:539e4b31b6dc |
|
410 | 4:539e4b31b6dc | |
174 | $ hg commit -m 'fail' -d '4 0' |
|
411 | $ hg commit -m 'fail' -d '4 0' | |
175 | precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
|
412 | precommit hook: HG_HOOKNAME=precommit | |
176 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
413 | HG_HOOKTYPE=precommit | |
177 | pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a |
|
414 | HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |
|
415 | ||||
|
416 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |||
|
417 | HG_HOOKTYPE=pretxnopen | |||
|
418 | HG_TXNID=TXN:$ID$ | |||
|
419 | HG_TXNNAME=commit | |||
|
420 | ||||
|
421 | pretxncommit hook: HG_HOOKNAME=pretxncommit | |||
|
422 | HG_HOOKTYPE=pretxncommit | |||
|
423 | HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 | |||
|
424 | HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
425 | HG_PENDING=$TESTTMP/a | |||
|
426 | ||||
178 | 5:6f611f8018c1 |
|
427 | 5:6f611f8018c1 | |
179 | 5:6f611f8018c1 |
|
428 | 5:6f611f8018c1 | |
180 | pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1 HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a |
|
429 | pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1 | |
|
430 | HG_HOOKTYPE=pretxncommit | |||
|
431 | HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 | |||
|
432 | HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
433 | HG_PENDING=$TESTTMP/a | |||
|
434 | ||||
181 | transaction abort! |
|
435 | transaction abort! | |
182 | txnabort Python hook: txnid,txnname |
|
436 | txnabort Python hook: txnid,txnname | |
183 | txnabort hook: HG_HOOKNAME=txnabort.1 HG_HOOKTYPE=txnabort HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
437 | txnabort hook: HG_HOOKNAME=txnabort.1 | |
|
438 | HG_HOOKTYPE=txnabort | |||
|
439 | HG_TXNID=TXN:$ID$ | |||
|
440 | HG_TXNNAME=commit | |||
|
441 | ||||
184 | rollback completed |
|
442 | rollback completed | |
185 | abort: pretxncommit.forbid1 hook exited with status 1 |
|
443 | abort: pretxncommit.forbid1 hook exited with status 1 | |
186 | [255] |
|
444 | [255] | |
@@ -205,11 +463,17 more there after | |||||
205 | precommit hook can prevent commit |
|
463 | precommit hook can prevent commit | |
206 |
|
464 | |||
207 | $ cat >> .hg/hgrc <<EOF |
|
465 | $ cat >> .hg/hgrc <<EOF | |
208 | > precommit.forbid = sh -c "printenv.py precommit.forbid 1" |
|
466 | > precommit.forbid = sh -c "printenv.py --line precommit.forbid 1" | |
209 | > EOF |
|
467 | > EOF | |
210 | $ hg commit -m 'fail' -d '4 0' |
|
468 | $ hg commit -m 'fail' -d '4 0' | |
211 | precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
|
469 | precommit hook: HG_HOOKNAME=precommit | |
212 | precommit.forbid hook: HG_HOOKNAME=precommit.forbid HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
|
470 | HG_HOOKTYPE=precommit | |
|
471 | HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
472 | ||||
|
473 | precommit.forbid hook: HG_HOOKNAME=precommit.forbid | |||
|
474 | HG_HOOKTYPE=precommit | |||
|
475 | HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
476 | ||||
213 | abort: precommit.forbid hook exited with status 1 |
|
477 | abort: precommit.forbid hook exited with status 1 | |
214 | [255] |
|
478 | [255] | |
215 | $ hg -q tip |
|
479 | $ hg -q tip | |
@@ -218,26 +482,36 precommit hook can prevent commit | |||||
218 | preupdate hook can prevent update |
|
482 | preupdate hook can prevent update | |
219 |
|
483 | |||
220 | $ cat >> .hg/hgrc <<EOF |
|
484 | $ cat >> .hg/hgrc <<EOF | |
221 | > preupdate = sh -c "printenv.py preupdate" |
|
485 | > preupdate = sh -c "printenv.py --line preupdate" | |
222 | > EOF |
|
486 | > EOF | |
223 | $ hg update 1 |
|
487 | $ hg update 1 | |
224 |
preupdate hook: HG_HOOKNAME=preupdate |
|
488 | preupdate hook: HG_HOOKNAME=preupdate | |
|
489 | HG_HOOKTYPE=preupdate | |||
|
490 | HG_PARENT1=ab228980c14d | |||
|
491 | ||||
225 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
492 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
226 |
|
493 | |||
227 | update hook |
|
494 | update hook | |
228 |
|
495 | |||
229 | $ cat >> .hg/hgrc <<EOF |
|
496 | $ cat >> .hg/hgrc <<EOF | |
230 | > update = sh -c "printenv.py update" |
|
497 | > update = sh -c "printenv.py --line update" | |
231 | > EOF |
|
498 | > EOF | |
232 | $ hg update |
|
499 | $ hg update | |
233 |
preupdate hook: HG_HOOKNAME=preupdate |
|
500 | preupdate hook: HG_HOOKNAME=preupdate | |
234 | update hook: HG_ERROR=0 HG_HOOKNAME=update HG_HOOKTYPE=update HG_PARENT1=539e4b31b6dc |
|
501 | HG_HOOKTYPE=preupdate | |
|
502 | HG_PARENT1=539e4b31b6dc | |||
|
503 | ||||
|
504 | update hook: HG_ERROR=0 | |||
|
505 | HG_HOOKNAME=update | |||
|
506 | HG_HOOKTYPE=update | |||
|
507 | HG_PARENT1=539e4b31b6dc | |||
|
508 | ||||
235 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
509 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
236 |
|
510 | |||
237 | pushkey hook |
|
511 | pushkey hook | |
238 |
|
512 | |||
239 | $ cat >> .hg/hgrc <<EOF |
|
513 | $ cat >> .hg/hgrc <<EOF | |
240 | > pushkey = sh -c "printenv.py pushkey" |
|
514 | > pushkey = sh -c "printenv.py --line pushkey" | |
241 | > EOF |
|
515 | > EOF | |
242 | $ cd ../b |
|
516 | $ cd ../b | |
243 | $ hg bookmark -r null foo |
|
517 | $ hg bookmark -r null foo | |
@@ -245,10 +519,41 pushkey hook | |||||
245 | pushing to ../a |
|
519 | pushing to ../a | |
246 | searching for changes |
|
520 | searching for changes | |
247 | no changes found |
|
521 | no changes found | |
248 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push |
|
522 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |
249 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a |
|
523 | HG_HOOKTYPE=pretxnopen | |
250 | pushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
524 | HG_TXNID=TXN:$ID$ | |
251 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a |
|
525 | HG_TXNNAME=push | |
|
526 | ||||
|
527 | pretxnclose hook: HG_BOOKMARK_MOVED=1 | |||
|
528 | HG_BUNDLE2=1 | |||
|
529 | HG_HOOKNAME=pretxnclose | |||
|
530 | HG_HOOKTYPE=pretxnclose | |||
|
531 | HG_PENDING=$TESTTMP/a | |||
|
532 | HG_SOURCE=push | |||
|
533 | HG_TXNID=TXN:$ID$ | |||
|
534 | HG_TXNNAME=push | |||
|
535 | HG_URL=file:$TESTTMP/a | |||
|
536 | ||||
|
537 | pushkey hook: HG_BUNDLE2=1 | |||
|
538 | HG_HOOKNAME=pushkey | |||
|
539 | HG_HOOKTYPE=pushkey | |||
|
540 | HG_KEY=foo | |||
|
541 | HG_NAMESPACE=bookmarks | |||
|
542 | HG_NEW=0000000000000000000000000000000000000000 | |||
|
543 | HG_PUSHKEYCOMPAT=1 | |||
|
544 | HG_SOURCE=push | |||
|
545 | HG_TXNID=TXN:$ID$ | |||
|
546 | HG_URL=file:$TESTTMP/a | |||
|
547 | ||||
|
548 | txnclose hook: HG_BOOKMARK_MOVED=1 | |||
|
549 | HG_BUNDLE2=1 | |||
|
550 | HG_HOOKNAME=txnclose | |||
|
551 | HG_HOOKTYPE=txnclose | |||
|
552 | HG_SOURCE=push | |||
|
553 | HG_TXNID=TXN:$ID$ | |||
|
554 | HG_TXNNAME=push | |||
|
555 | HG_URL=file:$TESTTMP/a | |||
|
556 | ||||
252 | exporting bookmark foo |
|
557 | exporting bookmark foo | |
253 | [1] |
|
558 | [1] | |
254 | $ cd ../a |
|
559 | $ cd ../a | |
@@ -256,16 +561,35 pushkey hook | |||||
256 | listkeys hook |
|
561 | listkeys hook | |
257 |
|
562 | |||
258 | $ cat >> .hg/hgrc <<EOF |
|
563 | $ cat >> .hg/hgrc <<EOF | |
259 | > listkeys = sh -c "printenv.py listkeys" |
|
564 | > listkeys = sh -c "printenv.py --line listkeys" | |
260 | > EOF |
|
565 | > EOF | |
261 | $ hg bookmark -r null bar |
|
566 | $ hg bookmark -r null bar | |
262 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
567 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |
263 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
568 | HG_HOOKTYPE=pretxnopen | |
264 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
569 | HG_TXNID=TXN:$ID$ | |
|
570 | HG_TXNNAME=bookmark | |||
|
571 | ||||
|
572 | pretxnclose hook: HG_BOOKMARK_MOVED=1 | |||
|
573 | HG_HOOKNAME=pretxnclose | |||
|
574 | HG_HOOKTYPE=pretxnclose | |||
|
575 | HG_PENDING=$TESTTMP/a | |||
|
576 | HG_TXNID=TXN:$ID$ | |||
|
577 | HG_TXNNAME=bookmark | |||
|
578 | ||||
|
579 | txnclose hook: HG_BOOKMARK_MOVED=1 | |||
|
580 | HG_HOOKNAME=txnclose | |||
|
581 | HG_HOOKTYPE=txnclose | |||
|
582 | HG_TXNID=TXN:$ID$ | |||
|
583 | HG_TXNNAME=bookmark | |||
|
584 | ||||
265 | $ cd ../b |
|
585 | $ cd ../b | |
266 | $ hg pull -B bar ../a |
|
586 | $ hg pull -B bar ../a | |
267 | pulling from ../a |
|
587 | pulling from ../a | |
268 | listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} |
|
588 | listkeys hook: HG_HOOKNAME=listkeys | |
|
589 | HG_HOOKTYPE=listkeys | |||
|
590 | HG_NAMESPACE=bookmarks | |||
|
591 | HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} | |||
|
592 | ||||
269 | no changes found |
|
593 | no changes found | |
270 | adding remote bookmark bar |
|
594 | adding remote bookmark bar | |
271 | $ cd ../a |
|
595 | $ cd ../a | |
@@ -273,18 +597,40 listkeys hook | |||||
273 | test that prepushkey can prevent incoming keys |
|
597 | test that prepushkey can prevent incoming keys | |
274 |
|
598 | |||
275 | $ cat >> .hg/hgrc <<EOF |
|
599 | $ cat >> .hg/hgrc <<EOF | |
276 | > prepushkey = sh -c "printenv.py prepushkey.forbid 1" |
|
600 | > prepushkey = sh -c "printenv.py --line prepushkey.forbid 1" | |
277 | > EOF |
|
601 | > EOF | |
278 | $ cd ../b |
|
602 | $ cd ../b | |
279 | $ hg bookmark -r null baz |
|
603 | $ hg bookmark -r null baz | |
280 | $ hg push -B baz ../a |
|
604 | $ hg push -B baz ../a | |
281 | pushing to ../a |
|
605 | pushing to ../a | |
282 | searching for changes |
|
606 | searching for changes | |
283 | listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} |
|
607 | listkeys hook: HG_HOOKNAME=listkeys | |
284 | listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} |
|
608 | HG_HOOKTYPE=listkeys | |
|
609 | HG_NAMESPACE=phases | |||
|
610 | HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} | |||
|
611 | ||||
|
612 | listkeys hook: HG_HOOKNAME=listkeys | |||
|
613 | HG_HOOKTYPE=listkeys | |||
|
614 | HG_NAMESPACE=bookmarks | |||
|
615 | HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} | |||
|
616 | ||||
285 | no changes found |
|
617 | no changes found | |
286 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push |
|
618 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |
287 | prepushkey.forbid hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
619 | HG_HOOKTYPE=pretxnopen | |
|
620 | HG_TXNID=TXN:$ID$ | |||
|
621 | HG_TXNNAME=push | |||
|
622 | ||||
|
623 | prepushkey.forbid hook: HG_BUNDLE2=1 | |||
|
624 | HG_HOOKNAME=prepushkey | |||
|
625 | HG_HOOKTYPE=prepushkey | |||
|
626 | HG_KEY=baz | |||
|
627 | HG_NAMESPACE=bookmarks | |||
|
628 | HG_NEW=0000000000000000000000000000000000000000 | |||
|
629 | HG_PUSHKEYCOMPAT=1 | |||
|
630 | HG_SOURCE=push | |||
|
631 | HG_TXNID=TXN:$ID$ | |||
|
632 | HG_URL=file:$TESTTMP/a | |||
|
633 | ||||
288 | abort: prepushkey hook exited with status 1 |
|
634 | abort: prepushkey hook exited with status 1 | |
289 | [255] |
|
635 | [255] | |
290 | $ cd ../a |
|
636 | $ cd ../a | |
@@ -292,16 +638,34 test that prepushkey can prevent incomin | |||||
292 | test that prelistkeys can prevent listing keys |
|
638 | test that prelistkeys can prevent listing keys | |
293 |
|
639 | |||
294 | $ cat >> .hg/hgrc <<EOF |
|
640 | $ cat >> .hg/hgrc <<EOF | |
295 | > prelistkeys = sh -c "printenv.py prelistkeys.forbid 1" |
|
641 | > prelistkeys = sh -c "printenv.py --line prelistkeys.forbid 1" | |
296 | > EOF |
|
642 | > EOF | |
297 | $ hg bookmark -r null quux |
|
643 | $ hg bookmark -r null quux | |
298 | pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
644 | pretxnopen hook: HG_HOOKNAME=pretxnopen | |
299 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
645 | HG_HOOKTYPE=pretxnopen | |
300 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
646 | HG_TXNID=TXN:$ID$ | |
|
647 | HG_TXNNAME=bookmark | |||
|
648 | ||||
|
649 | pretxnclose hook: HG_BOOKMARK_MOVED=1 | |||
|
650 | HG_HOOKNAME=pretxnclose | |||
|
651 | HG_HOOKTYPE=pretxnclose | |||
|
652 | HG_PENDING=$TESTTMP/a | |||
|
653 | HG_TXNID=TXN:$ID$ | |||
|
654 | HG_TXNNAME=bookmark | |||
|
655 | ||||
|
656 | txnclose hook: HG_BOOKMARK_MOVED=1 | |||
|
657 | HG_HOOKNAME=txnclose | |||
|
658 | HG_HOOKTYPE=txnclose | |||
|
659 | HG_TXNID=TXN:$ID$ | |||
|
660 | HG_TXNNAME=bookmark | |||
|
661 | ||||
301 | $ cd ../b |
|
662 | $ cd ../b | |
302 | $ hg pull -B quux ../a |
|
663 | $ hg pull -B quux ../a | |
303 | pulling from ../a |
|
664 | pulling from ../a | |
304 |
prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys |
|
665 | prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys | |
|
666 | HG_HOOKTYPE=prelistkeys | |||
|
667 | HG_NAMESPACE=bookmarks | |||
|
668 | ||||
305 | abort: prelistkeys hook exited with status 1 |
|
669 | abort: prelistkeys hook exited with status 1 | |
306 | [255] |
|
670 | [255] | |
307 | $ cd ../a |
|
671 | $ cd ../a | |
@@ -314,12 +678,17 prechangegroup hook can prevent incoming | |||||
314 | 3:07f3376c1e65 |
|
678 | 3:07f3376c1e65 | |
315 | $ cat > .hg/hgrc <<EOF |
|
679 | $ cat > .hg/hgrc <<EOF | |
316 | > [hooks] |
|
680 | > [hooks] | |
317 | > prechangegroup.forbid = sh -c "printenv.py prechangegroup.forbid 1" |
|
681 | > prechangegroup.forbid = sh -c "printenv.py --line prechangegroup.forbid 1" | |
318 | > EOF |
|
682 | > EOF | |
319 | $ hg pull ../a |
|
683 | $ hg pull ../a | |
320 | pulling from ../a |
|
684 | pulling from ../a | |
321 | searching for changes |
|
685 | searching for changes | |
322 |
prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid |
|
686 | prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid | |
|
687 | HG_HOOKTYPE=prechangegroup | |||
|
688 | HG_SOURCE=pull | |||
|
689 | HG_TXNID=TXN:$ID$ | |||
|
690 | HG_URL=file:$TESTTMP/a | |||
|
691 | ||||
323 | abort: prechangegroup.forbid hook exited with status 1 |
|
692 | abort: prechangegroup.forbid hook exited with status 1 | |
324 | [255] |
|
693 | [255] | |
325 |
|
694 | |||
@@ -329,7 +698,7 incoming changes no longer there after | |||||
329 | $ cat > .hg/hgrc <<EOF |
|
698 | $ cat > .hg/hgrc <<EOF | |
330 | > [hooks] |
|
699 | > [hooks] | |
331 | > pretxnchangegroup.forbid0 = hg tip -q |
|
700 | > pretxnchangegroup.forbid0 = hg tip -q | |
332 | > pretxnchangegroup.forbid1 = sh -c "printenv.py pretxnchangegroup.forbid 1" |
|
701 | > pretxnchangegroup.forbid1 = sh -c "printenv.py --line pretxnchangegroup.forbid 1" | |
333 | > EOF |
|
702 | > EOF | |
334 | $ hg pull ../a |
|
703 | $ hg pull ../a | |
335 | pulling from ../a |
|
704 | pulling from ../a | |
@@ -339,7 +708,15 incoming changes no longer there after | |||||
339 | adding file changes |
|
708 | adding file changes | |
340 | added 1 changesets with 1 changes to 1 files |
|
709 | added 1 changesets with 1 changes to 1 files | |
341 | 4:539e4b31b6dc |
|
710 | 4:539e4b31b6dc | |
342 | pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1 HG_HOOKTYPE=pretxnchangegroup HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
711 | pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1 | |
|
712 | HG_HOOKTYPE=pretxnchangegroup | |||
|
713 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
714 | HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
715 | HG_PENDING=$TESTTMP/b | |||
|
716 | HG_SOURCE=pull | |||
|
717 | HG_TXNID=TXN:$ID$ | |||
|
718 | HG_URL=file:$TESTTMP/a | |||
|
719 | ||||
343 | transaction abort! |
|
720 | transaction abort! | |
344 | rollback completed |
|
721 | rollback completed | |
345 | abort: pretxnchangegroup.forbid1 hook exited with status 1 |
|
722 | abort: pretxnchangegroup.forbid1 hook exited with status 1 | |
@@ -352,14 +729,21 outgoing hooks can see env vars | |||||
352 | $ rm .hg/hgrc |
|
729 | $ rm .hg/hgrc | |
353 | $ cat > ../a/.hg/hgrc <<EOF |
|
730 | $ cat > ../a/.hg/hgrc <<EOF | |
354 | > [hooks] |
|
731 | > [hooks] | |
355 | > preoutgoing = sh -c "printenv.py preoutgoing" |
|
732 | > preoutgoing = sh -c "printenv.py --line preoutgoing" | |
356 | > outgoing = sh -c "printenv.py outgoing" |
|
733 | > outgoing = sh -c "printenv.py --line outgoing" | |
357 | > EOF |
|
734 | > EOF | |
358 | $ hg pull ../a |
|
735 | $ hg pull ../a | |
359 | pulling from ../a |
|
736 | pulling from ../a | |
360 | searching for changes |
|
737 | searching for changes | |
361 |
preoutgoing hook: HG_HOOKNAME=preoutgoing |
|
738 | preoutgoing hook: HG_HOOKNAME=preoutgoing | |
362 | outgoing hook: HG_HOOKNAME=outgoing HG_HOOKTYPE=outgoing HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull |
|
739 | HG_HOOKTYPE=preoutgoing | |
|
740 | HG_SOURCE=pull | |||
|
741 | ||||
|
742 | outgoing hook: HG_HOOKNAME=outgoing | |||
|
743 | HG_HOOKTYPE=outgoing | |||
|
744 | HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |||
|
745 | HG_SOURCE=pull | |||
|
746 | ||||
363 | adding changesets |
|
747 | adding changesets | |
364 | adding manifests |
|
748 | adding manifests | |
365 | adding file changes |
|
749 | adding file changes | |
@@ -373,13 +757,19 outgoing hooks can see env vars | |||||
373 | preoutgoing hook can prevent outgoing changes |
|
757 | preoutgoing hook can prevent outgoing changes | |
374 |
|
758 | |||
375 | $ cat >> ../a/.hg/hgrc <<EOF |
|
759 | $ cat >> ../a/.hg/hgrc <<EOF | |
376 | > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1" |
|
760 | > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1" | |
377 | > EOF |
|
761 | > EOF | |
378 | $ hg pull ../a |
|
762 | $ hg pull ../a | |
379 | pulling from ../a |
|
763 | pulling from ../a | |
380 | searching for changes |
|
764 | searching for changes | |
381 |
preoutgoing hook: HG_HOOKNAME=preoutgoing |
|
765 | preoutgoing hook: HG_HOOKNAME=preoutgoing | |
382 | preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=pull |
|
766 | HG_HOOKTYPE=preoutgoing | |
|
767 | HG_SOURCE=pull | |||
|
768 | ||||
|
769 | preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid | |||
|
770 | HG_HOOKTYPE=preoutgoing | |||
|
771 | HG_SOURCE=pull | |||
|
772 | ||||
383 | abort: preoutgoing.forbid hook exited with status 1 |
|
773 | abort: preoutgoing.forbid hook exited with status 1 | |
384 | [255] |
|
774 | [255] | |
385 |
|
775 | |||
@@ -388,12 +778,19 outgoing hooks work for local clones | |||||
388 | $ cd .. |
|
778 | $ cd .. | |
389 | $ cat > a/.hg/hgrc <<EOF |
|
779 | $ cat > a/.hg/hgrc <<EOF | |
390 | > [hooks] |
|
780 | > [hooks] | |
391 | > preoutgoing = sh -c "printenv.py preoutgoing" |
|
781 | > preoutgoing = sh -c "printenv.py --line preoutgoing" | |
392 | > outgoing = sh -c "printenv.py outgoing" |
|
782 | > outgoing = sh -c "printenv.py --line outgoing" | |
393 | > EOF |
|
783 | > EOF | |
394 | $ hg clone a c |
|
784 | $ hg clone a c | |
395 |
preoutgoing hook: HG_HOOKNAME=preoutgoing |
|
785 | preoutgoing hook: HG_HOOKNAME=preoutgoing | |
396 | outgoing hook: HG_HOOKNAME=outgoing HG_HOOKTYPE=outgoing HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone |
|
786 | HG_HOOKTYPE=preoutgoing | |
|
787 | HG_SOURCE=clone | |||
|
788 | ||||
|
789 | outgoing hook: HG_HOOKNAME=outgoing | |||
|
790 | HG_HOOKTYPE=outgoing | |||
|
791 | HG_NODE=0000000000000000000000000000000000000000 | |||
|
792 | HG_SOURCE=clone | |||
|
793 | ||||
397 | updating to branch default |
|
794 | updating to branch default | |
398 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
795 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
399 | $ rm -rf c |
|
796 | $ rm -rf c | |
@@ -401,11 +798,17 outgoing hooks work for local clones | |||||
401 | preoutgoing hook can prevent outgoing changes for local clones |
|
798 | preoutgoing hook can prevent outgoing changes for local clones | |
402 |
|
799 | |||
403 | $ cat >> a/.hg/hgrc <<EOF |
|
800 | $ cat >> a/.hg/hgrc <<EOF | |
404 | > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1" |
|
801 | > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1" | |
405 | > EOF |
|
802 | > EOF | |
406 | $ hg clone a zzz |
|
803 | $ hg clone a zzz | |
407 |
preoutgoing hook: HG_HOOKNAME=preoutgoing |
|
804 | preoutgoing hook: HG_HOOKNAME=preoutgoing | |
408 | preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=clone |
|
805 | HG_HOOKTYPE=preoutgoing | |
|
806 | HG_SOURCE=clone | |||
|
807 | ||||
|
808 | preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid | |||
|
809 | HG_HOOKTYPE=preoutgoing | |||
|
810 | HG_SOURCE=clone | |||
|
811 | ||||
409 | abort: preoutgoing.forbid hook exited with status 1 |
|
812 | abort: preoutgoing.forbid hook exited with status 1 | |
410 | [255] |
|
813 | [255] | |
411 |
|
814 | |||
@@ -780,10 +1183,16 This also creates the `to` repo for the | |||||
780 | $ cd .. |
|
1183 | $ cd .. | |
781 | $ cat << EOF >> hgrc-with-post-init-hook |
|
1184 | $ cat << EOF >> hgrc-with-post-init-hook | |
782 | > [hooks] |
|
1185 | > [hooks] | |
783 | > post-init = sh -c "printenv.py post-init" |
|
1186 | > post-init = sh -c "printenv.py --line post-init" | |
784 | > EOF |
|
1187 | > EOF | |
785 | $ HGRCPATH=hgrc-with-post-init-hook hg init to |
|
1188 | $ HGRCPATH=hgrc-with-post-init-hook hg init to | |
786 | post-init hook: HG_ARGS=init to HG_HOOKNAME=post-init HG_HOOKTYPE=post-init HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''} HG_PATS=['to'] HG_RESULT=0 |
|
1189 | post-init hook: HG_ARGS=init to | |
|
1190 | HG_HOOKNAME=post-init | |||
|
1191 | HG_HOOKTYPE=post-init | |||
|
1192 | HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''} | |||
|
1193 | HG_PATS=['to'] | |||
|
1194 | HG_RESULT=0 | |||
|
1195 | ||||
787 |
|
1196 | |||
788 | new commits must be visible in pretxnchangegroup (issue3428) |
|
1197 | new commits must be visible in pretxnchangegroup (issue3428) | |
789 |
|
1198 |
General Comments 0
You need to be logged in to leave comments.
Login now