context: add tags() method
authorMatt Mackall <mpm@selenic.com>
Thu, 21 Jun 2007 11:42:39 -0500
changeset 4663 6b2e8cb39583
parent 4662 f9b8ea362b49
child 4664 dedb8abfd0e1
context: add tags() method
mercurial/context.py
--- a/mercurial/context.py	Thu Jun 21 11:42:39 2007 -0500
+++ b/mercurial/context.py	Thu Jun 21 11:42:39 2007 -0500
@@ -67,6 +67,7 @@
     def files(self): return self._changeset[3]
     def description(self): return self._changeset[4]
     def branch(self): return self._changeset[5].get("branch")
+    def tags(self): return self._repo.nodetags(self._node)
 
     def parents(self):
         """return contexts for each parent changeset"""
@@ -413,6 +414,11 @@
     def clean(self): return self._status[5]
     def branch(self): return self._repo.dirstate.branch()
 
+    def tags(self):
+        t = []
+        [t.extend(p.tags()) for p in self.parents()]
+        return t
+
     def parents(self):
         """return contexts for each parent changeset"""
         return self._parents