##// END OF EJS Templates
test-hook: use printenv.py
Alexis S. L. Carvalho -
r4286:94951607 default
parent child Browse files
Show More
@@ -1,208 +1,213 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 cp "$TESTDIR"/printenv.py .
4
3 # commit hooks can see env vars
5 # commit hooks can see env vars
4 hg init a
6 hg init a
5 cd a
7 cd a
6 echo "[hooks]" > .hg/hgrc
8 echo "[hooks]" > .hg/hgrc
7 echo 'commit = echo commit hook: n=$HG_NODE p1=$HG_PARENT1 p2=$HG_PARENT2' >> .hg/hgrc
9 echo 'commit = python ../printenv.py commit' >> .hg/hgrc
8 echo 'commit.b = echo commit hook b' >> .hg/hgrc
10 echo 'commit.b = python ../printenv.py commit.b' >> .hg/hgrc
9 echo 'precommit = echo precommit hook: p1=$HG_PARENT1 p2=$HG_PARENT2' >> .hg/hgrc
11 echo 'precommit = python ../printenv.py precommit' >> .hg/hgrc
10 echo 'pretxncommit = echo pretxncommit hook: n=$HG_NODE p1=$HG_PARENT1 p2=$HG_PARENT2; hg -q tip' >> .hg/hgrc
12 echo 'pretxncommit = python ../printenv.py pretxncommit' >> .hg/hgrc
13 echo 'pretxncommit.tip = hg -q tip' >> .hg/hgrc
11 echo a > a
14 echo a > a
12 hg add a
15 hg add a
13 hg commit -m a -d "1000000 0"
16 hg commit -m a -d "1000000 0"
14
17
15 hg clone . ../b
18 hg clone . ../b
16 cd ../b
19 cd ../b
17
20
18 # changegroup hooks can see env vars
21 # changegroup hooks can see env vars
19 echo '[hooks]' > .hg/hgrc
22 echo '[hooks]' > .hg/hgrc
20 echo 'prechangegroup = echo prechangegroup hook: u=`echo $HG_URL | sed s,file:.*,file:,`' >> .hg/hgrc
23 echo 'prechangegroup = python ../printenv.py prechangegroup' >> .hg/hgrc
21 echo 'changegroup = echo changegroup hook: n=$HG_NODE u=`echo $HG_URL | sed s,file:.*,file:,`' >> .hg/hgrc
24 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
22 echo 'incoming = echo incoming hook: n=$HG_NODE u=`echo $HG_URL | sed s,file:.*,file:,`' >> .hg/hgrc
25 echo 'incoming = python ../printenv.py incoming' >> .hg/hgrc
23
26
24 # pretxncommit and commit hooks can see both parents of merge
27 # pretxncommit and commit hooks can see both parents of merge
25 cd ../a
28 cd ../a
26 echo b >> a
29 echo b >> a
27 hg commit -m a1 -d "1 0"
30 hg commit -m a1 -d "1 0"
28 hg update -C 0
31 hg update -C 0
29 echo b > b
32 echo b > b
30 hg add b
33 hg add b
31 hg commit -m b -d '1 0'
34 hg commit -m b -d '1 0'
32 hg merge 1
35 hg merge 1
33 hg commit -m merge -d '2 0'
36 hg commit -m merge -d '2 0'
34
37
35 cd ../b
38 cd ../b
36 hg pull ../a
39 hg pull ../a
37
40
38 # tag hooks can see env vars
41 # tag hooks can see env vars
39 cd ../a
42 cd ../a
40 echo 'pretag = echo pretag hook: t=$HG_TAG n=$HG_NODE l=$HG_LOCAL' >> .hg/hgrc
43 echo 'pretag = python ../printenv.py pretag' >> .hg/hgrc
41 echo 'tag = echo tag hook: t=$HG_TAG n=$HG_NODE l=$HG_LOCAL' >> .hg/hgrc
44 echo 'tag = python ../printenv.py tag' >> .hg/hgrc
42 hg tag -d '3 0' a
45 hg tag -d '3 0' a
43 hg tag -l la
46 hg tag -l la
44
47
45 # pretag hook can forbid tagging
48 # pretag hook can forbid tagging
46 echo 'pretag.forbid = echo pretag.forbid hook; exit 1' >> .hg/hgrc
49 echo 'pretag.forbid = python ../printenv.py pretag.forbid 1' >> .hg/hgrc
47 hg tag -d '4 0' fa
50 hg tag -d '4 0' fa
48 hg tag -l fla
51 hg tag -l fla
49
52
50 # pretxncommit hook can see changeset, can roll back txn, changeset
53 # pretxncommit hook can see changeset, can roll back txn, changeset
51 # no more there after
54 # no more there after
52 echo 'pretxncommit.forbid = echo pretxncommit.forbid hook: tip=`hg -q tip`; exit 1' >> .hg/hgrc
55 echo 'pretxncommit.forbid0 = hg tip -q' >> .hg/hgrc
56 echo 'pretxncommit.forbid1 = python ../printenv.py pretxncommit.forbid 1' >> .hg/hgrc
53 echo z > z
57 echo z > z
54 hg add z
58 hg add z
55 hg -q tip
59 hg -q tip
56 hg commit -m 'fail' -d '4 0'
60 hg commit -m 'fail' -d '4 0'
57 hg -q tip
61 hg -q tip
58
62
59 # precommit hook can prevent commit
63 # precommit hook can prevent commit
60 echo 'precommit.forbid = echo precommit.forbid hook; exit 1' >> .hg/hgrc
64 echo 'precommit.forbid = python ../printenv.py precommit.forbid 1' >> .hg/hgrc
61 hg commit -m 'fail' -d '4 0'
65 hg commit -m 'fail' -d '4 0'
62 hg -q tip
66 hg -q tip
63
67
64 # preupdate hook can prevent update
68 # preupdate hook can prevent update
65 echo 'preupdate = echo preupdate hook: p1=$HG_PARENT1 p2=$HG_PARENT2' >> .hg/hgrc
69 echo 'preupdate = python ../printenv.py preupdate' >> .hg/hgrc
66 hg update 1
70 hg update 1
67
71
68 # update hook
72 # update hook
69 echo 'update = echo update hook: p1=$HG_PARENT1 p2=$HG_PARENT2 err=$HG_ERROR' >> .hg/hgrc
73 echo 'update = python ../printenv.py update' >> .hg/hgrc
70 hg update
74 hg update
71
75
72 # prechangegroup hook can prevent incoming changes
76 # prechangegroup hook can prevent incoming changes
73 cd ../b
77 cd ../b
74 hg -q tip
78 hg -q tip
75 echo '[hooks]' > .hg/hgrc
79 echo '[hooks]' > .hg/hgrc
76 echo 'prechangegroup.forbid = echo prechangegroup.forbid hook; exit 1' >> .hg/hgrc
80 echo 'prechangegroup.forbid = python ../printenv.py prechangegroup.forbid 1' >> .hg/hgrc
77 hg pull ../a
81 hg pull ../a
78
82
79 # pretxnchangegroup hook can see incoming changes, can roll back txn,
83 # pretxnchangegroup hook can see incoming changes, can roll back txn,
80 # incoming changes no longer there after
84 # incoming changes no longer there after
81 echo '[hooks]' > .hg/hgrc
85 echo '[hooks]' > .hg/hgrc
82 echo 'pretxnchangegroup.forbid = echo pretxnchangegroup.forbid hook: tip=`hg -q tip`; exit 1' >> .hg/hgrc
86 echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc
87 echo 'pretxnchangegroup.forbid1 = python ../printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc
83 hg pull ../a
88 hg pull ../a
84 hg -q tip
89 hg -q tip
85
90
86 # outgoing hooks can see env vars
91 # outgoing hooks can see env vars
87 rm .hg/hgrc
92 rm .hg/hgrc
88 echo '[hooks]' > ../a/.hg/hgrc
93 echo '[hooks]' > ../a/.hg/hgrc
89 echo 'preoutgoing = echo preoutgoing hook: s=$HG_SOURCE' >> ../a/.hg/hgrc
94 echo 'preoutgoing = python ../printenv.py preoutgoing' >> ../a/.hg/hgrc
90 echo 'outgoing = echo outgoing hook: n=$HG_NODE s=$HG_SOURCE' >> ../a/.hg/hgrc
95 echo 'outgoing = python ../printenv.py outgoing' >> ../a/.hg/hgrc
91 hg pull ../a
96 hg pull ../a
92 hg rollback
97 hg rollback
93
98
94 # preoutgoing hook can prevent outgoing changes
99 # preoutgoing hook can prevent outgoing changes
95 echo 'preoutgoing.forbid = echo preoutgoing.forbid hook; exit 1' >> ../a/.hg/hgrc
100 echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
96 hg pull ../a
101 hg pull ../a
97
102
98 cat > hooktests.py <<EOF
103 cat > hooktests.py <<EOF
99 from mercurial import util
104 from mercurial import util
100
105
101 uncallable = 0
106 uncallable = 0
102
107
103 def printargs(args):
108 def printargs(args):
104 args.pop('ui', None)
109 args.pop('ui', None)
105 args.pop('repo', None)
110 args.pop('repo', None)
106 a = list(args.items())
111 a = list(args.items())
107 a.sort()
112 a.sort()
108 print 'hook args:'
113 print 'hook args:'
109 for k, v in a:
114 for k, v in a:
110 print ' ', k, v
115 print ' ', k, v
111
116
112 def passhook(**args):
117 def passhook(**args):
113 printargs(args)
118 printargs(args)
114
119
115 def failhook(**args):
120 def failhook(**args):
116 printargs(args)
121 printargs(args)
117 return True
122 return True
118
123
119 class LocalException(Exception):
124 class LocalException(Exception):
120 pass
125 pass
121
126
122 def raisehook(**args):
127 def raisehook(**args):
123 raise LocalException('exception from hook')
128 raise LocalException('exception from hook')
124
129
125 def aborthook(**args):
130 def aborthook(**args):
126 raise util.Abort('raise abort from hook')
131 raise util.Abort('raise abort from hook')
127
132
128 def brokenhook(**args):
133 def brokenhook(**args):
129 return 1 + {}
134 return 1 + {}
130
135
131 class container:
136 class container:
132 unreachable = 1
137 unreachable = 1
133 EOF
138 EOF
134
139
135 echo '# test python hooks'
140 echo '# test python hooks'
136 PYTHONPATH="`pwd`:$PYTHONPATH"
141 PYTHONPATH="`pwd`:$PYTHONPATH"
137 export PYTHONPATH
142 export PYTHONPATH
138
143
139 echo '[hooks]' > ../a/.hg/hgrc
144 echo '[hooks]' > ../a/.hg/hgrc
140 echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
145 echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
141 hg pull ../a 2>&1 | grep 'raised an exception'
146 hg pull ../a 2>&1 | grep 'raised an exception'
142
147
143 echo '[hooks]' > ../a/.hg/hgrc
148 echo '[hooks]' > ../a/.hg/hgrc
144 echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
149 echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
145 hg pull ../a 2>&1 | grep 'raised an exception'
150 hg pull ../a 2>&1 | grep 'raised an exception'
146
151
147 echo '[hooks]' > ../a/.hg/hgrc
152 echo '[hooks]' > ../a/.hg/hgrc
148 echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
153 echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
149 hg pull ../a
154 hg pull ../a
150
155
151 echo '[hooks]' > ../a/.hg/hgrc
156 echo '[hooks]' > ../a/.hg/hgrc
152 echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
157 echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
153 hg pull ../a
158 hg pull ../a
154
159
155 echo '[hooks]' > ../a/.hg/hgrc
160 echo '[hooks]' > ../a/.hg/hgrc
156 echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
161 echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
157 hg pull ../a
162 hg pull ../a
158
163
159 echo '[hooks]' > ../a/.hg/hgrc
164 echo '[hooks]' > ../a/.hg/hgrc
160 echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
165 echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
161 hg pull ../a
166 hg pull ../a
162
167
163 echo '[hooks]' > ../a/.hg/hgrc
168 echo '[hooks]' > ../a/.hg/hgrc
164 echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
169 echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
165 hg pull ../a
170 hg pull ../a
166
171
167 echo '[hooks]' > ../a/.hg/hgrc
172 echo '[hooks]' > ../a/.hg/hgrc
168 echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
173 echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
169 hg pull ../a
174 hg pull ../a
170
175
171 echo '[hooks]' > ../a/.hg/hgrc
176 echo '[hooks]' > ../a/.hg/hgrc
172 echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
177 echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
173 hg pull ../a
178 hg pull ../a
174
179
175 echo '[hooks]' > ../a/.hg/hgrc
180 echo '[hooks]' > ../a/.hg/hgrc
176 echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
181 echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
177 hg pull ../a
182 hg pull ../a
178
183
179 echo '# make sure --traceback works'
184 echo '# make sure --traceback works'
180 echo '[hooks]' > .hg/hgrc
185 echo '[hooks]' > .hg/hgrc
181 echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
186 echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
182
187
183 echo a >> a
188 echo a >> a
184 hg --traceback commit -A -m a 2>&1 | grep '^Traceback'
189 hg --traceback commit -A -m a 2>&1 | grep '^Traceback'
185
190
186 cd ..
191 cd ..
187 hg init c
192 hg init c
188 cd c
193 cd c
189
194
190 cat > hookext.py <<EOF
195 cat > hookext.py <<EOF
191 def autohook(**args):
196 def autohook(**args):
192 print "Automatically installed hook"
197 print "Automatically installed hook"
193
198
194 def reposetup(ui, repo):
199 def reposetup(ui, repo):
195 repo.ui.setconfig("hooks", "commit.auto", autohook)
200 repo.ui.setconfig("hooks", "commit.auto", autohook)
196 EOF
201 EOF
197 echo '[extensions]' >> .hg/hgrc
202 echo '[extensions]' >> .hg/hgrc
198 echo 'hookext = hookext.py' >> .hg/hgrc
203 echo 'hookext = hookext.py' >> .hg/hgrc
199
204
200 touch foo
205 touch foo
201 hg add foo
206 hg add foo
202 hg ci -m 'add foo'
207 hg ci -m 'add foo'
203 echo >> foo
208 echo >> foo
204 hg ci --debug -m 'change foo' | sed -e 's/ at .*>/>/'
209 hg ci --debug -m 'change foo' | sed -e 's/ at .*>/>/'
205
210
206 hg showconfig hooks | sed -e 's/ at .*>/>/'
211 hg showconfig hooks | sed -e 's/ at .*>/>/'
207
212
208 exit 0
213 exit 0
@@ -1,145 +1,146 b''
1 precommit hook: p1=0000000000000000000000000000000000000000 p2=
1 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 HG_PARENT2=
2 pretxncommit hook: n=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b p1=0000000000000000000000000000000000000000 p2=
2 pretxncommit hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000 HG_PARENT2=
3 0:29b62aeb769f
3 0:29b62aeb769f
4 commit hook: n=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b p1=0000000000000000000000000000000000000000 p2=
4 commit hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000 HG_PARENT2=
5 commit hook b
5 commit.b hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000 HG_PARENT2=
6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
7 precommit hook: p1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b p2=
7 precommit hook: HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT2=
8 pretxncommit hook: n=b702efe9688826e3a91283852b328b84dbf37bc2 p1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b p2=
8 pretxncommit hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT2=
9 1:b702efe96888
9 1:b702efe96888
10 commit hook: n=b702efe9688826e3a91283852b328b84dbf37bc2 p1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b p2=
10 commit hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT2=
11 commit hook b
11 commit.b hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT2=
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 precommit hook: p1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b p2=
13 precommit hook: HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT2=
14 pretxncommit hook: n=1324a5531bac09b329c3845d35ae6a7526874edb p1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b p2=
14 pretxncommit hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT2=
15 2:1324a5531bac
15 2:1324a5531bac
16 commit hook: n=1324a5531bac09b329c3845d35ae6a7526874edb p1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b p2=
16 commit hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT2=
17 commit hook b
17 commit.b hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT2=
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 (branch merge, don't forget to commit)
19 (branch merge, don't forget to commit)
20 precommit hook: p1=1324a5531bac09b329c3845d35ae6a7526874edb p2=b702efe9688826e3a91283852b328b84dbf37bc2
20 precommit hook: HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2
21 pretxncommit hook: n=4c52fb2e402287dd5dc052090682536c8406c321 p1=1324a5531bac09b329c3845d35ae6a7526874edb p2=b702efe9688826e3a91283852b328b84dbf37bc2
21 pretxncommit hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2
22 3:4c52fb2e4022
22 3:4c52fb2e4022
23 commit hook: n=4c52fb2e402287dd5dc052090682536c8406c321 p1=1324a5531bac09b329c3845d35ae6a7526874edb p2=b702efe9688826e3a91283852b328b84dbf37bc2
23 commit hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2
24 commit hook b
24 commit.b hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2
25 prechangegroup hook: u=file:
25 prechangegroup hook: HG_SOURCE=pull HG_URL=file:
26 changegroup hook: n=b702efe9688826e3a91283852b328b84dbf37bc2 u=file:
26 changegroup hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_SOURCE=pull HG_URL=file:
27 incoming hook: n=b702efe9688826e3a91283852b328b84dbf37bc2 u=file:
27 incoming hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_SOURCE=pull HG_URL=file:
28 incoming hook: n=1324a5531bac09b329c3845d35ae6a7526874edb u=file:
28 incoming hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_SOURCE=pull HG_URL=file:
29 incoming hook: n=4c52fb2e402287dd5dc052090682536c8406c321 u=file:
29 incoming hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_SOURCE=pull HG_URL=file:
30 pulling from ../a
30 pulling from ../a
31 searching for changes
31 searching for changes
32 adding changesets
32 adding changesets
33 adding manifests
33 adding manifests
34 adding file changes
34 adding file changes
35 added 3 changesets with 2 changes to 2 files
35 added 3 changesets with 2 changes to 2 files
36 (run 'hg update' to get a working copy)
36 (run 'hg update' to get a working copy)
37 pretag hook: t=a n=4c52fb2e402287dd5dc052090682536c8406c321 l=0
37 pretag hook: HG_LOCAL=0 HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_TAG=a
38 precommit hook: p1=4c52fb2e402287dd5dc052090682536c8406c321 p2=
38 precommit hook: HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT2=
39 pretxncommit hook: n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p1=4c52fb2e402287dd5dc052090682536c8406c321 p2=
39 pretxncommit hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT2=
40 4:8ea2ef7ad3e8
40 4:8ea2ef7ad3e8
41 commit hook: n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p1=4c52fb2e402287dd5dc052090682536c8406c321 p2=
41 commit hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT2=
42 commit hook b
42 commit.b hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT2=
43 tag hook: t=a n=4c52fb2e402287dd5dc052090682536c8406c321 l=0
43 tag hook: HG_LOCAL=0 HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_TAG=a
44 pretag hook: t=la n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 l=1
44 pretag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=la
45 tag hook: t=la n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 l=1
45 tag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=la
46 pretag hook: t=fa n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 l=0
46 pretag hook: HG_LOCAL=0 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fa
47 pretag.forbid hook
47 pretag.forbid hook: HG_LOCAL=0 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fa
48 abort: pretag.forbid hook exited with status 1
48 abort: pretag.forbid hook exited with status 1
49 pretag hook: t=fla n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 l=1
49 pretag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fla
50 pretag.forbid hook
50 pretag.forbid hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fla
51 abort: pretag.forbid hook exited with status 1
51 abort: pretag.forbid hook exited with status 1
52 4:8ea2ef7ad3e8
52 4:8ea2ef7ad3e8
53 precommit hook: p1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p2=
53 precommit hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT2=
54 pretxncommit hook: n=fad284daf8c032148abaffcd745dafeceefceb61 p1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p2=
54 pretxncommit hook: HG_NODE=fad284daf8c032148abaffcd745dafeceefceb61 HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT2=
55 5:fad284daf8c0
55 5:fad284daf8c0
56 pretxncommit.forbid hook: tip=5:fad284daf8c0
56 pretxncommit.forbid hook: HG_NODE=fad284daf8c032148abaffcd745dafeceefceb61 HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT2=
57 abort: pretxncommit.forbid hook exited with status 1
57 abort: pretxncommit.forbid1 hook exited with status 1
58 transaction abort!
58 transaction abort!
59 rollback completed
59 rollback completed
60 4:8ea2ef7ad3e8
60 4:8ea2ef7ad3e8
61 precommit hook: p1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p2=
61 precommit hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT2=
62 precommit.forbid hook
62 precommit.forbid hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT2=
63 abort: precommit.forbid hook exited with status 1
63 abort: precommit.forbid hook exited with status 1
64 4:8ea2ef7ad3e8
64 4:8ea2ef7ad3e8
65 preupdate hook: p1=b702efe96888 p2=
65 preupdate hook: HG_PARENT1=b702efe96888 HG_PARENT2=
66 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
66 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
67 preupdate hook: p1=8ea2ef7ad3e8 p2=
67 preupdate hook: HG_PARENT1=8ea2ef7ad3e8 HG_PARENT2=
68 update hook: p1=8ea2ef7ad3e8 p2= err=0
68 update hook: HG_ERROR=0 HG_PARENT1=8ea2ef7ad3e8 HG_PARENT2=
69 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 3:4c52fb2e4022
70 3:4c52fb2e4022
71 prechangegroup.forbid hook
71 prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:
72 pulling from ../a
72 pulling from ../a
73 searching for changes
73 searching for changes
74 abort: prechangegroup.forbid hook exited with status 1
74 abort: prechangegroup.forbid hook exited with status 1
75 pretxnchangegroup.forbid hook: tip=4:8ea2ef7ad3e8
75 4:8ea2ef7ad3e8
76 pretxnchangegroup.forbid hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_SOURCE=pull HG_URL=file:
76 pulling from ../a
77 pulling from ../a
77 searching for changes
78 searching for changes
78 adding changesets
79 adding changesets
79 adding manifests
80 adding manifests
80 adding file changes
81 adding file changes
81 added 1 changesets with 1 changes to 1 files
82 added 1 changesets with 1 changes to 1 files
82 abort: pretxnchangegroup.forbid hook exited with status 1
83 abort: pretxnchangegroup.forbid1 hook exited with status 1
83 transaction abort!
84 transaction abort!
84 rollback completed
85 rollback completed
85 3:4c52fb2e4022
86 3:4c52fb2e4022
86 preoutgoing hook: s=pull
87 preoutgoing hook: HG_SOURCE=pull
87 outgoing hook: n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 s=pull
88 outgoing hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_SOURCE=pull
88 pulling from ../a
89 pulling from ../a
89 searching for changes
90 searching for changes
90 adding changesets
91 adding changesets
91 adding manifests
92 adding manifests
92 adding file changes
93 adding file changes
93 added 1 changesets with 1 changes to 1 files
94 added 1 changesets with 1 changes to 1 files
94 (run 'hg update' to get a working copy)
95 (run 'hg update' to get a working copy)
95 rolling back last transaction
96 rolling back last transaction
96 preoutgoing hook: s=pull
97 preoutgoing hook: HG_SOURCE=pull
97 preoutgoing.forbid hook
98 preoutgoing.forbid hook: HG_SOURCE=pull
98 pulling from ../a
99 pulling from ../a
99 searching for changes
100 searching for changes
100 abort: preoutgoing.forbid hook exited with status 1
101 abort: preoutgoing.forbid hook exited with status 1
101 # test python hooks
102 # test python hooks
102 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
103 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
103 error: preoutgoing.raise hook raised an exception: exception from hook
104 error: preoutgoing.raise hook raised an exception: exception from hook
104 pulling from ../a
105 pulling from ../a
105 searching for changes
106 searching for changes
106 error: preoutgoing.abort hook failed: raise abort from hook
107 error: preoutgoing.abort hook failed: raise abort from hook
107 abort: raise abort from hook
108 abort: raise abort from hook
108 pulling from ../a
109 pulling from ../a
109 searching for changes
110 searching for changes
110 hook args:
111 hook args:
111 hooktype preoutgoing
112 hooktype preoutgoing
112 source pull
113 source pull
113 abort: preoutgoing.fail hook failed
114 abort: preoutgoing.fail hook failed
114 pulling from ../a
115 pulling from ../a
115 searching for changes
116 searching for changes
116 abort: preoutgoing.uncallable hook is invalid ("hooktests.uncallable" is not callable)
117 abort: preoutgoing.uncallable hook is invalid ("hooktests.uncallable" is not callable)
117 pulling from ../a
118 pulling from ../a
118 searching for changes
119 searching for changes
119 abort: preoutgoing.nohook hook is invalid ("hooktests.nohook" is not defined)
120 abort: preoutgoing.nohook hook is invalid ("hooktests.nohook" is not defined)
120 pulling from ../a
121 pulling from ../a
121 searching for changes
122 searching for changes
122 abort: preoutgoing.nomodule hook is invalid ("nomodule" not in a module)
123 abort: preoutgoing.nomodule hook is invalid ("nomodule" not in a module)
123 pulling from ../a
124 pulling from ../a
124 searching for changes
125 searching for changes
125 abort: preoutgoing.badmodule hook is invalid (import of "nomodule" failed)
126 abort: preoutgoing.badmodule hook is invalid (import of "nomodule" failed)
126 pulling from ../a
127 pulling from ../a
127 searching for changes
128 searching for changes
128 abort: preoutgoing.unreachable hook is invalid (import of "hooktests.container" failed)
129 abort: preoutgoing.unreachable hook is invalid (import of "hooktests.container" failed)
129 pulling from ../a
130 pulling from ../a
130 searching for changes
131 searching for changes
131 hook args:
132 hook args:
132 hooktype preoutgoing
133 hooktype preoutgoing
133 source pull
134 source pull
134 adding changesets
135 adding changesets
135 adding manifests
136 adding manifests
136 adding file changes
137 adding file changes
137 added 1 changesets with 1 changes to 1 files
138 added 1 changesets with 1 changes to 1 files
138 (run 'hg update' to get a working copy)
139 (run 'hg update' to get a working copy)
139 # make sure --traceback works
140 # make sure --traceback works
140 Traceback (most recent call last):
141 Traceback (most recent call last):
141 Automatically installed hook
142 Automatically installed hook
142 foo
143 foo
143 calling hook commit.auto: <function autohook>
144 calling hook commit.auto: <function autohook>
144 Automatically installed hook
145 Automatically installed hook
145 hooks.commit.auto=<function autohook>
146 hooks.commit.auto=<function autohook>
General Comments 0
You need to be logged in to leave comments. Login now