Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 49077:5b65721a75eb
revlog: recommit 49fd21f32695 with a fix for issue6528
`filelog.size` currently special cases two forms of metadata encoding:
- copy data via the parent order as flag bit
- censor data by peaking into the raw delta
All other forms of metadata encoding including the empty metadata block
are mishandled. In `basefilectx.cmp` the empty metadata block is
explicitly checked to compensate for this.
Restore 49fd21f32695, but disable it for filelog, so that the original
flag bit use contines to work. Document all this mess for now in
preparation of a proper rework.
Differential Revision: https://phab.mercurial-scm.org/D11203
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Tue, 20 Jul 2021 15:07:10 +0200 |
parents | 642e31cb55f0 |
children | d44e3c45f0e4 |
line wrap: on
line diff
--- a/mercurial/context.py Fri Mar 18 12:23:47 2022 -0700 +++ b/mercurial/context.py Tue Jul 20 15:07:10 2021 +0200 @@ -992,6 +992,16 @@ if self._repo._encodefilterpats: # can't rely on size() because wdir content may be decoded return self._filelog.cmp(self._filenode, fctx.data()) + # filelog.size() has two special cases: + # - censored metadata + # - copy/rename tracking + # The first is detected by peaking into the delta, + # the second is detected by abusing parent order + # in the revlog index as flag bit. This leaves files using + # the dummy encoding and non-standard meta attributes. + # The following check is a special case for the empty + # metadata block used if the raw file content starts with '\1\n'. + # Cases of arbitrary metadata flags are currently mishandled. if self.size() - 4 == fctx.size(): # size() can match: # if file data starts with '\1\n', empty metadata block is