[PATCH STABLE] keyword: use fctx.filenode() instead of internal var (issue5364)

Christian Ebert blacktrash at gmx.net
Thu Sep 8 16:12:34 UTC 2016


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1473350741 -3600
#      Thu Sep 08 17:05:41 2016 +0100
# Branch stable
# Node ID d4f2b7b5b2e382dcc34409ddcb89b9280262c2d0
# Parent  e7766022a61a66a7c4218526b647f96bd442a4ce
keyword: use fctx.filenode() instead of internal var (issue5364)

I caved in to the proposal to use internal _filenode variable:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2010-October/025237.html

Use the exposed filenode() function instead.

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -739,7 +739,7 @@ def reposetup(ui, repo):
     def kwfilectx_cmp(orig, self, fctx):
         # keyword affects data size, comparing wdir and filelog size does
         # not make sense
-        if (fctx._filenode is None and
+        if (fctx.filenode() is None and
             (self._repo._encodefilterpats or
              kwt.match(fctx.path()) and 'l' not in fctx.flags() or
              self.size() - 4 == fctx.size()) or


More information about the Mercurial-devel mailing list