hg tag: run tag hook just once
authorJohn Coomes <john.coomes@sun.com>
Tue, 18 Dec 2007 12:45:30 -0800
changeset 5747 f75ca1b0c81e
parent 5746 d3ef7e86bc3b
child 5748 5957c7b5894a
hg tag: run tag hook just once
mercurial/localrepo.py
tests/test-hook.out
--- a/mercurial/localrepo.py	Tue Dec 18 22:50:27 2007 +0100
+++ b/mercurial/localrepo.py	Tue Dec 18 12:45:30 2007 -0800
@@ -123,7 +123,6 @@
                 fp.write('\n')
             fp.write('%s %s\n' % (hex(node), munge and munge(name) or name))
             fp.close()
-            self.hook('tag', node=hex(node), tag=name, local=local)
 
         prevtags = ''
         if local:
@@ -136,6 +135,7 @@
 
             # local tags are stored in the current charset
             writetag(fp, name, None, prevtags)
+            self.hook('tag', node=hex(node), tag=name, local=local)
             return
 
         if use_dirstate:
--- a/tests/test-hook.out	Tue Dec 18 22:50:27 2007 +0100
+++ b/tests/test-hook.out	Tue Dec 18 12:45:30 2007 -0800
@@ -40,7 +40,6 @@
 added 3 changesets with 2 changes to 2 files
 (run 'hg update' to get a working copy)
 pretag hook: HG_LOCAL=0 HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_TAG=a 
-tag hook: HG_LOCAL=0 HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_TAG=a 
 precommit hook: HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 
 pretxncommit hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 
 4:8ea2ef7ad3e8