##// END OF EJS Templates
add prechangegroup and pretxnchangegroup hooks....
Vadim Gelfer -
r1730:0f1d2c75 default
parent child Browse files
Show More
@@ -146,8 +146,8 b' hooks::'
146 incoming.autobuild = /my/build/hook
146 incoming.autobuild = /my/build/hook
147
147
148 changegroup;;
148 changegroup;;
149 Run after a changegroup has been added via push or pull. Passed
149 Run after a changegroup has been added via push, pull or
150 the ID of the first new changeset in $NODE.
150 unbundle. Passed the ID of the first new changeset in $NODE.
151 commit;;
151 commit;;
152 Run after a changeset has been created in the local repository.
152 Run after a changeset has been created in the local repository.
153 Passed the ID of the newly created changeset in environment
153 Passed the ID of the newly created changeset in environment
@@ -156,6 +156,10 b' hooks::'
156 Run after a changeset has been pulled, pushed, or unbundled into
156 Run after a changeset has been pulled, pushed, or unbundled into
157 the local repository. Passed the ID of the newly arrived
157 the local repository. Passed the ID of the newly arrived
158 changeset in environment variable $NODE.
158 changeset in environment variable $NODE.
159 prechangegroup;;
160 Run before a changegroup is added via push, pull or unbundle.
161 Exit status 0 allows the changegroup to proceed. Non-zero status
162 will cause the push, pull or unbundle to fail.
159 precommit;;
163 precommit;;
160 Run before starting a local commit. Exit status 0 allows the
164 Run before starting a local commit. Exit status 0 allows the
161 commit to proceed. Non-zero status will cause the commit to
165 commit to proceed. Non-zero status will cause the commit to
@@ -165,6 +169,14 b' hooks::'
165 created. Non-zero status will cause the tag to fail. ID of
169 created. Non-zero status will cause the tag to fail. ID of
166 changeset to tag in $NODE. Name of tag in $TAG. Tag is local if
170 changeset to tag in $NODE. Name of tag in $TAG. Tag is local if
167 $LOCAL=1, in repo if $LOCAL=0.
171 $LOCAL=1, in repo if $LOCAL=0.
172 pretxnchangegroup;;
173 Run after a changegroup has been added via push, pull or unbundle,
174 but before the transaction has been committed. Changegroup is
175 visible to hook program. This lets you validate incoming changes
176 before accepting them. Passed the ID of the first new changeset
177 in $NODE. Exit status 0 allows the transaction to commit.
178 Non-zero status will cause the transaction to be rolled back and
179 the push, pull or unbundle will fail.
168 pretxncommit;;
180 pretxncommit;;
169 Run after a changeset has been created but the transaction not yet
181 Run after a changeset has been created but the transaction not yet
170 committed. Changeset is visible to hook program. This lets you
182 committed. Changeset is visible to hook program. This lets you
@@ -1342,6 +1342,9 b' class localrepository(object):'
1342
1342
1343 if not source:
1343 if not source:
1344 return
1344 return
1345
1346 self.hook('prechangegroup', throw=True)
1347
1345 changesets = files = revisions = 0
1348 changesets = files = revisions = 0
1346
1349
1347 tr = self.transaction()
1350 tr = self.transaction()
@@ -1384,6 +1387,9 b' class localrepository(object):'
1384 " with %d changes to %d files%s\n")
1387 " with %d changes to %d files%s\n")
1385 % (changesets, revisions, files, heads))
1388 % (changesets, revisions, files, heads))
1386
1389
1390 self.hook('pretxnchangegroup', throw=True,
1391 node=hex(self.changelog.node(cor+1)))
1392
1387 tr.close()
1393 tr.close()
1388
1394
1389 if changesets > 0:
1395 if changesets > 0:
General Comments 0
You need to be logged in to leave comments. Login now