[PATCH] filectx: replace use of _filerev with _filenode

Durham Goode durham at fb.com
Mon Feb 8 22:48:20 UTC 2016


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1454969831 28800
#      Mon Feb 08 14:17:11 2016 -0800
# Node ID b8f90918f80e13e468d0fa22ca2f678896223cbd
# Parent  01a5143cd25f285f8c745a92986cd7186bb32c90
filectx: replace use of _filerev with _filenode

_filerev depends on the filelog implementation using revlogs and linkrevs.
Alternative implementations, like remotefilelog, do not have rev numbers, so
this call fails. Replacing it with _filenode means it doesn't rely on rev
numbers, and doesn't cost anything extra, since _filerev is using _filenode
under the hood anyway.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -789,7 +789,7 @@ class basefilectx(object):
         if fctx._customcmp:
             return fctx.cmp(self)
 
-        if (fctx._filerev is None
+        if (fctx._filenode is None
             and (self._repo._encodefilterpats
                  # if file data starts with '\1\n', empty metadata block is
                  # prepended, which adds 4 bytes to filelog.size().


More information about the Mercurial-devel mailing list