D434: context: add `decodeddata()` to basefilectx
phillco (Phil Cohen)
phabricator at mercurial-scm.org
Thu Aug 17 18:29:27 UTC 2017
phillco created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This will be used as an abstraction by simplemerge to get the data it used to
read off the filesystem.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D434
AFFECTED FILES
mercurial/context.py
CHANGE DETAILS
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1056,6 +1056,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
To: phillco, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list