##// END OF EJS Templates
context: collapse complex condition to see if filelog have to be compared...
Yuya Nishihara -
r41026:39953bcf default
parent child Browse files
Show More
@@ -702,14 +702,20 b' class basefilectx(object):'
702 if fctx._customcmp:
702 if fctx._customcmp:
703 return fctx.cmp(self)
703 return fctx.cmp(self)
704
704
705 if (fctx._filenode is None
705 if fctx._filenode is None:
706 and (self._repo._encodefilterpats
706 if self._repo._encodefilterpats:
707 # can't rely on size() because wdir content may be decoded
708 return self._filelog.cmp(self._filenode, fctx.data())
709 if self.size() - 4 == fctx.size():
710 # size() can match:
707 # if file data starts with '\1\n', empty metadata block is
711 # if file data starts with '\1\n', empty metadata block is
708 # prepended, which adds 4 bytes to filelog.size().
712 # prepended, which adds 4 bytes to filelog.size().
709 or self.size() - 4 == fctx.size())
713 return self._filelog.cmp(self._filenode, fctx.data())
710 or self.size() == fctx.size()):
714 if self.size() == fctx.size():
715 # size() matches: need to compare content
711 return self._filelog.cmp(self._filenode, fctx.data())
716 return self._filelog.cmp(self._filenode, fctx.data())
712
717
718 # size() differs
713 return True
719 return True
714
720
715 def _adjustlinkrev(self, srcrev, inclusive=False, stoprev=None):
721 def _adjustlinkrev(self, srcrev, inclusive=False, stoprev=None):
General Comments 0
You need to be logged in to leave comments. Login now