Show More
@@ -147,35 +147,40 b' hooks::' | |||||
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 or pull. Passed | |
150 | the ID of the first new changeset in $NODE. |
|
150 | the ID of the first new changeset in $HG_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 | |
154 | variable $NODE. Parent changeset IDs in $P1 and $P2. |
|
154 | variable $HG_NODE. Parent changeset IDs in $HG_P1 and $HG_P2. | |
155 | incoming;; |
|
155 | incoming;; | |
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 $HG_NODE. | |
159 | precommit;; |
|
159 | precommit;; | |
160 | Run before starting a local commit. Exit status 0 allows the |
|
160 | Run before starting a local commit. Exit status 0 allows the | |
161 | commit to proceed. Non-zero status will cause the commit to |
|
161 | commit to proceed. Non-zero status will cause the commit to fail. | |
162 |
|
|
162 | Parent changeset IDs in $HG_P1 and $HG_P2. | |
163 | pretag;; |
|
163 | pretag;; | |
164 | Run before creating a tag. Exit status 0 allows the tag to be |
|
164 | Run before creating a tag. Exit status 0 allows the tag to be | |
165 | created. Non-zero status will cause the tag to fail. ID of |
|
165 | 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 |
|
166 | changeset to tag in $HG_NODE. Name of tag in $HG_TAG. Tag is | |
167 | $LOCAL=1, in repo if $LOCAL=0. |
|
167 | local if $HG_LOCAL=1, in repo if $HG_LOCAL=0. | |
168 | pretxncommit;; |
|
168 | pretxncommit;; | |
169 | Run after a changeset has been created but the transaction not yet |
|
169 | Run after a changeset has been created but the transaction not yet | |
170 | committed. Changeset is visible to hook program. This lets you |
|
170 | committed. Changeset is visible to hook program. This lets you | |
171 | validate commit message and changes. Exit status 0 allows the |
|
171 | validate commit message and changes. Exit status 0 allows the | |
172 | commit to proceed. Non-zero status will cause the transaction to |
|
172 | commit to proceed. Non-zero status will cause the transaction to | |
173 |
be rolled back. ID of changeset in $NODE. Parent changeset |
|
173 | be rolled back. ID of changeset in $HG_NODE. Parent changeset | |
174 | in $P1 and $P2. |
|
174 | IDs in $HG_P1 and $HG_P2. | |
175 | tag;; |
|
175 | tag;; | |
176 | Run after a tag is created. ID of tagged changeset in $NODE. |
|
176 | Run after a tag is created. ID of tagged changeset in $HG_NODE. | |
177 | Name of tag in $TAG. Tag is local if $LOCAL=1, in repo if |
|
177 | Name of tag in $HG_TAG. Tag is local if $HG_LOCAL=1, in repo if | |
178 | $LOCAL=0. |
|
178 | $HG_LOCAL=0. | |
|
179 | ||||
|
180 | In earlier releases, the names of hook environment variables did not | |||
|
181 | have a "HG_" prefix. These unprefixed names are still provided in | |||
|
182 | the environment for backwards compatibility, but their use is | |||
|
183 | deprecated, and they will be removed in a future release. | |||
179 |
|
184 | |||
180 | http_proxy:: |
|
185 | http_proxy:: | |
181 | Used to access web-based Mercurial repositories through a HTTP |
|
186 | Used to access web-based Mercurial repositories through a HTTP |
@@ -54,7 +54,9 b' class localrepository(object):' | |||||
54 | old = {} |
|
54 | old = {} | |
55 | for k, v in args.items(): |
|
55 | for k, v in args.items(): | |
56 | k = k.upper() |
|
56 | k = k.upper() | |
|
57 | old['HG_' + k] = os.environ.get(k, None) | |||
57 | old[k] = os.environ.get(k, None) |
|
58 | old[k] = os.environ.get(k, None) | |
|
59 | os.environ['HG_' + k] = str(v) | |||
58 | os.environ[k] = str(v) |
|
60 | os.environ[k] = str(v) | |
59 |
|
61 | |||
60 | try: |
|
62 | try: | |
@@ -64,7 +66,7 b' class localrepository(object):' | |||||
64 | r = os.system(cmd) |
|
66 | r = os.system(cmd) | |
65 | finally: |
|
67 | finally: | |
66 | for k, v in old.items(): |
|
68 | for k, v in old.items(): | |
67 |
if v |
|
69 | if v is not None: | |
68 | os.environ[k] = v |
|
70 | os.environ[k] = v | |
69 | else: |
|
71 | else: | |
70 | del os.environ[k] |
|
72 | del os.environ[k] |
General Comments 0
You need to be logged in to leave comments.
Login now