Patchwork [1,of,3,V3] manifest: expose the parents() method

login
register
mail settings
Submitter Mateusz Kwapich
Date Nov. 21, 2016, 4:13 p.m.
Message ID <7dfd4c184ee087f2c05e.1479744810@devvm314.lla2.facebook.com>
Download mbox | patch
Permalink /patch/17669/
State Accepted
Headers show

Comments

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

Patch

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