##// END OF EJS Templates
add pretag and tag hooks....
Vadim Gelfer -
r1720:55017891 default
parent child Browse files
Show More
@@ -159,6 +159,15 b' hooks::'
159 159 precommit;;
160 160 Run before starting a commit. Exit status 0 allows the commit to
161 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 172 http_proxy::
164 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 2113 if name.find(c) >= 0:
2114 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 2119 if opts['local']:
2117 2120 repo.opener("localtags", "a").write("%s %s\n" % (r, name))
2121 repo.hook('tag', node=r, tag=name, local=1)
2118 2122 return
2119 2123
2120 2124 for x in repo.changes():
@@ -2130,6 +2134,7 b' def tag(ui, repo, name, rev_=None, **opt'
2130 2134 _("Added tag %s for changeset %s") % (name, r))
2131 2135 try:
2132 2136 repo.commit([".hgtags"], message, opts['user'], opts['date'])
2137 repo.hook('tag', node=r, tag=name, local=0)
2133 2138 except ValueError, inst:
2134 2139 raise util.Abort(str(inst))
2135 2140
General Comments 0
You need to be logged in to leave comments. Login now