[PATCH 2 of 4] mq: Add a statusentrymap method on mqrepo to easily get patchname for a node

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Jun 11 12:32:00 UTC 2011


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1307795150 -7200
# Node ID 2f70c7b232afab89e3dff1c94d013ae6c99c4a54
# Parent  877d353a386690bb6b744ad7a6630ccf87617040
mq: Add a statusentrymap method on mqrepo to easily get patchname for a node.

diff -r 877d353a3866 -r 2f70c7b232af hgext/mq.py
--- a/hgext/mq.py	Sat Jun 11 14:25:42 2011 +0200
+++ b/hgext/mq.py	Sat Jun 11 14:25:50 2011 +0200
@@ -301,6 +301,13 @@
             return list(parselines(lines))
         return []
 
+    # can't cache as there is no easy way to detect change in applied
+    # we should improve applied to handle this.
+    @property
+    def statusentrymap(self):
+        """Return a node -> statusentry mapping for applied patches"""
+        return dict([(e.node, e) for e in self.applied])
+
     @util.propertycache
     def full_series(self):
         if os.path.exists(self.join(self.series_path)):



More information about the Mercurial-devel mailing list