##// END OF EJS Templates
fix names of parent changeset ids in hooks....
Vadim Gelfer -
r1727:019e6a47 default
parent child Browse files
Show More
@@ -145,37 +145,41 b' hooks::'
145 145 incoming.email = /my/email/hook
146 146 incoming.autobuild = /my/build/hook
147 147
148 Most hooks are run with environment variables set that give added
149 useful information. For each hook below, the environment variables
150 it is passed are listed with names of the form "$HG_foo".
151
148 152 changegroup;;
149 Run after a changegroup has been added via push or pull. Passed
150 the ID of the first new changeset in $HG_NODE.
153 Run after a changegroup has been added via push or pull. ID of the
154 first new changeset is in $HG_NODE.
151 155 commit;;
152 156 Run after a changeset has been created in the local repository.
153 Passed the ID of the newly created changeset in environment
154 variable $HG_NODE. Parent changeset IDs in $HG_P1 and $HG_P2.
157 ID of the newly created changeset is in $HG_NODE. Parent
158 changeset IDs are in $HG_PARENT1 and $HG_PARENT2.
155 159 incoming;;
156 160 Run after a changeset has been pulled, pushed, or unbundled into
157 the local repository. Passed the ID of the newly arrived
158 changeset in environment variable $HG_NODE.
161 the local repository. The ID of the newly arrived changeset is in
162 $HG_NODE.
159 163 precommit;;
160 164 Run before starting a local commit. Exit status 0 allows the
161 165 commit to proceed. Non-zero status will cause the commit to fail.
162 Parent changeset IDs in $HG_P1 and $HG_P2.
166 Parent changeset IDs are in $HG_PARENT1 and $HG_PARENT2.
163 167 pretag;;
164 168 Run before creating a tag. Exit status 0 allows the tag to be
165 169 created. Non-zero status will cause the tag to fail. ID of
166 changeset to tag in $HG_NODE. Name of tag in $HG_TAG. Tag is
167 local if $HG_LOCAL=1, in repo if $HG_LOCAL=0.
170 changeset to tag is in $HG_NODE. Name of tag is in $HG_TAG. Tag
171 is local if $HG_LOCAL=1, in repo if $HG_LOCAL=0.
168 172 pretxncommit;;
169 173 Run after a changeset has been created but the transaction not yet
170 174 committed. Changeset is visible to hook program. This lets you
171 175 validate commit message and changes. Exit status 0 allows the
172 176 commit to proceed. Non-zero status will cause the transaction to
173 be rolled back. ID of changeset in $HG_NODE. Parent changeset
174 IDs in $HG_P1 and $HG_P2.
177 be rolled back. ID of changeset is in $HG_NODE. Parent changeset
178 IDs are in $HG_PARENT1 and $HG_PARENT2.
175 179 tag;;
176 Run after a tag is created. ID of tagged changeset in $HG_NODE.
177 Name of tag in $HG_TAG. Tag is local if $HG_LOCAL=1, in repo if
178 $HG_LOCAL=0.
180 Run after a tag is created. ID of tagged changeset is in
181 $HG_NODE. Name of tag is in $HG_TAG. Tag is local if
182 $HG_LOCAL=1, in repo if $HG_LOCAL=0.
179 183
180 184 In earlier releases, the names of hook environment variables did not
181 185 have a "HG_" prefix. These unprefixed names are still provided in
@@ -382,7 +382,7 b' class localrepository(object):'
382 382 if p2 == nullid: xp2 = ''
383 383 else: xp2 = hex(p2)
384 384
385 self.hook("precommit", throw=True, p1=xp1, p2=xp2)
385 self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
386 386
387 387 if not wlock:
388 388 wlock = self.wlock()
@@ -468,14 +468,15 b' class localrepository(object):'
468 468
469 469 user = user or self.ui.username()
470 470 n = self.changelog.add(mn, changed + remove, text, tr, p1, p2, user, date)
471 self.hook('pretxncommit', throw=True, node=hex(n), p1=xp1, p2=xp2)
471 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
472 parent2=xp2)
472 473 tr.close()
473 474
474 475 self.dirstate.setparents(n)
475 476 self.dirstate.update(new, "n")
476 477 self.dirstate.forget(remove)
477 478
478 self.hook("commit", node=hex(n), p1=xp1, p2=xp2)
479 self.hook("commit", node=hex(n), parent1=xp1, parent2=xp2)
479 480 return n
480 481
481 482 def walk(self, node=None, files=[], match=util.always):
General Comments 0
You need to be logged in to leave comments. Login now