990 |
990 |
991 if fctx._filenode is None: |
991 if fctx._filenode is None: |
992 if self._repo._encodefilterpats: |
992 if self._repo._encodefilterpats: |
993 # can't rely on size() because wdir content may be decoded |
993 # can't rely on size() because wdir content may be decoded |
994 return self._filelog.cmp(self._filenode, fctx.data()) |
994 return self._filelog.cmp(self._filenode, fctx.data()) |
|
995 # filelog.size() has two special cases: |
|
996 # - censored metadata |
|
997 # - copy/rename tracking |
|
998 # The first is detected by peaking into the delta, |
|
999 # the second is detected by abusing parent order |
|
1000 # in the revlog index as flag bit. This leaves files using |
|
1001 # the dummy encoding and non-standard meta attributes. |
|
1002 # The following check is a special case for the empty |
|
1003 # metadata block used if the raw file content starts with '\1\n'. |
|
1004 # Cases of arbitrary metadata flags are currently mishandled. |
995 if self.size() - 4 == fctx.size(): |
1005 if self.size() - 4 == fctx.size(): |
996 # size() can match: |
1006 # size() can match: |
997 # if file data starts with '\1\n', empty metadata block is |
1007 # if file data starts with '\1\n', empty metadata block is |
998 # prepended, which adds 4 bytes to filelog.size(). |
1008 # prepended, which adds 4 bytes to filelog.size(). |
999 return self._filelog.cmp(self._filenode, fctx.data()) |
1009 return self._filelog.cmp(self._filenode, fctx.data()) |