changeset 4663:6b2e8cb39583

context: add tags() method
author Matt Mackall <mpm@selenic.com>
date Thu, 21 Jun 2007 11:42:39 -0500
parents f9b8ea362b49
children dedb8abfd0e1
files mercurial/context.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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