changeset 33901:f488223a87ab

context: add `decodeddata()` to basefilectx This will be used as an abstraction by simplemerge to get the data it used to read off the filesystem. Differential Revision: https://phab.mercurial-scm.org/D434
author Phil Cohen <phillco@fb.com>
date Thu, 24 Aug 2017 21:26:40 -0700
parents 10f1809ab98f
children f39ba8237ed6
files mercurial/context.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Mon Aug 21 08:52:46 2017 +0200
+++ b/mercurial/context.py	Thu Aug 24 21:26:40 2017 -0700
@@ -1097,6 +1097,13 @@
             c = visit.pop(max(visit))
             yield c
 
+    def decodeddata(self):
+        """Returns `data()` after running repository decoding filters.
+
+        This is often equivalent to how the data would be expressed on disk.
+        """
+        return self._repo.wwritedata(self.path(), self.data())
+
 def _annotatepair(parents, childfctx, child, skipchild, diffopts):
     r'''
     Given parent and child fctxes and annotate data for parents, for all lines