Patchwork D434: context: add `decodeddata()` to basefilectx

login
register
mail settings
Submitter phabricator
Date Aug. 25, 2017, 6:40 a.m.
Message ID <04760eda5ac8a67fcd01c701c3a3c37f@localhost.localdomain>
Download mbox | patch
Permalink /patch/23326/
State Not Applicable
Headers show

Comments

phabricator - Aug. 25, 2017, 6:40 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf488223a87ab: context: add `decodeddata()` to basefilectx (authored by phillco).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D434?vs=1219&id=1282

REVISION DETAIL
  https://phab.mercurial-scm.org/D434

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: phillco, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -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