[PATCH 1 of 3 V2] manifest: expose the parents() method

Mateusz Kwapich mitrandir at fb.com
Thu Nov 17 19:31:10 UTC 2016


# HG changeset patch
# User Mateusz Kwapich <mitrandir at fb.com>
# Date 1479409155 28800
#      Thu Nov 17 10:59:15 2016 -0800
# Node ID 7dfd4c184ee087f2c05e1bdae8a10ccefbff7a92
# Parent  96f2f50d923f94c23999df198ff16409e7539af8
manifest: expose the parents() method

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1381,6 +1381,10 @@ class manifestctx(object):
         memmf._manifestdict = self.read().copy()
         return memmf
 
+    @propertycache
+    def parents(self):
+        return self._revlog().parents(self._node)
+
     def read(self):
         if not self._data:
             if self._node == revlog.nullid:
@@ -1515,6 +1519,10 @@ class treemanifestctx(object):
         memmf._treemanifest = self.read().copy()
         return memmf
 
+    @propertycache
+    def parents(self):
+        return self._revlog().parents(self._node)
+
     def readdelta(self, shallow=False):
         '''Returns a manifest containing just the entries that are present
         in this manifest, but not in its p1 manifest. This is efficient to read


More information about the Mercurial-devel mailing list