changeset 22:93dd72d028a1

Automatically publish on tag.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Fri, 01 Jul 2011 14:55:02 +0200
parents aa0870d093b8
children 423c62a146c7
files states.py tests/test-ready.t
diffstat 2 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/states.py	Mon Jun 06 16:42:56 2011 +0200
+++ b/states.py	Fri Jul 01 14:55:02 2011 +0200
@@ -193,8 +193,9 @@
         return
 
     ocancopy =repo.cancopy
-    opull =repo.pull
-    opush =repo.push
+    opull = repo.pull
+    opush = repo.push
+    o_tag = repo._tag
     class statefulrepo(repo.__class__):
 
         def nodestate(self, node):
@@ -332,5 +333,10 @@
                 remote = map(node.bin, remote.listkeys('immutableheads'))
             return remote
 
+        def _tag(self, names, node, *args, **kwargs):
+            tagnode = o_tag(names, node, *args, **kwargs)
+            self.setstate(ST0, [node, tagnode])
+            return tagnode
+
     repo.__class__ = statefulrepo
 
--- a/tests/test-ready.t	Mon Jun 06 16:42:56 2011 +0200
+++ b/tests/test-ready.t	Fri Jul 01 14:55:02 2011 +0200
@@ -127,3 +127,20 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add c
   
+  $ hg tag -fr tip babar
+  $ hg log -r 'publishedheads()'
+  changeset:   5:cdaaa31e4239
+  tag:         babar
+  parent:      3:090483935bca
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add e
+  
+  changeset:   6:bd66bf1525ee
+  tag:         tip
+  parent:      4:fb98f3f5bba0
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag babar for changeset cdaaa31e4239
+  
+