From patchwork Wed Aug 23 19:37:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D434: context: add `decodeddata()` to basefilectx From: phabricator X-Patchwork-Id: 23270 Message-Id: <40e0eddf6ee9eed2cc332331f3f5c552@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Wed, 23 Aug 2017 19:37:53 +0000 phillco updated this revision to Diff 1219. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D434?vs=1036&id=1219 REVISION DETAIL https://phab.mercurial-scm.org/D434 AFFECTED FILES mercurial/context.py CHANGE DETAILS To: phillco, #hg-reviewers Cc: mercurial-devel 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