Show More
@@ -159,6 +159,15 b' hooks::' | |||||
159 | precommit;; |
|
159 | precommit;; | |
160 | Run before starting a commit. Exit status 0 allows the commit to |
|
160 | Run before starting a commit. Exit status 0 allows the commit to | |
161 | proceed. Non-zero status will cause the commit to fail. |
|
161 | proceed. Non-zero status will cause the commit to fail. | |
|
162 | pretag;; | |||
|
163 | Run before creating a tag. Exit status 0 allows the tag to be | |||
|
164 | created. Non-zero status will cause the tag to fail. ID of | |||
|
165 | changeset to tag in $NODE. Name of tag in $TAG. Tag is local if | |||
|
166 | $LOCAL=1, in repo if $LOCAL=0. | |||
|
167 | tag;; | |||
|
168 | Run after a tag is created. ID of tagged changeset in $NODE. | |||
|
169 | Name of tag in $TAG. Tag is local if $LOCAL=1, in repo if | |||
|
170 | $LOCAL=0. | |||
162 |
|
171 | |||
163 | http_proxy:: |
|
172 | http_proxy:: | |
164 | Used to access web-based Mercurial repositories through a HTTP |
|
173 | Used to access web-based Mercurial repositories through a HTTP |
@@ -2113,8 +2113,12 b' def tag(ui, repo, name, rev_=None, **opt' | |||||
2113 | if name.find(c) >= 0: |
|
2113 | if name.find(c) >= 0: | |
2114 | raise util.Abort(_("%s cannot be used in a tag name") % repr(c)) |
|
2114 | raise util.Abort(_("%s cannot be used in a tag name") % repr(c)) | |
2115 |
|
2115 | |||
|
2116 | repo.hook('pretag', throw=True, node=r, tag=name, | |||
|
2117 | local=not not opts['local']) | |||
|
2118 | ||||
2116 | if opts['local']: |
|
2119 | if opts['local']: | |
2117 | repo.opener("localtags", "a").write("%s %s\n" % (r, name)) |
|
2120 | repo.opener("localtags", "a").write("%s %s\n" % (r, name)) | |
|
2121 | repo.hook('tag', node=r, tag=name, local=1) | |||
2118 | return |
|
2122 | return | |
2119 |
|
2123 | |||
2120 | for x in repo.changes(): |
|
2124 | for x in repo.changes(): | |
@@ -2130,6 +2134,7 b' def tag(ui, repo, name, rev_=None, **opt' | |||||
2130 | _("Added tag %s for changeset %s") % (name, r)) |
|
2134 | _("Added tag %s for changeset %s") % (name, r)) | |
2131 | try: |
|
2135 | try: | |
2132 | repo.commit([".hgtags"], message, opts['user'], opts['date']) |
|
2136 | repo.commit([".hgtags"], message, opts['user'], opts['date']) | |
|
2137 | repo.hook('tag', node=r, tag=name, local=0) | |||
2133 | except ValueError, inst: |
|
2138 | except ValueError, inst: | |
2134 | raise util.Abort(str(inst)) |
|
2139 | raise util.Abort(str(inst)) | |
2135 |
|
2140 |
General Comments 0
You need to be logged in to leave comments.
Login now