Mercurial > public > mercurial-scm > hg
comparison mercurial/filelog.py @ 49012: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 | c577d394ed6b |
comparison
equal
deleted
inserted
replaced
49011:b999edb15f8c | 49012:5b65721a75eb |
---|---|
30 opener, | 30 opener, |
31 # XXX should use the unencoded path | 31 # XXX should use the unencoded path |
32 target=(revlog_constants.KIND_FILELOG, path), | 32 target=(revlog_constants.KIND_FILELOG, path), |
33 radix=b'/'.join((b'data', path)), | 33 radix=b'/'.join((b'data', path)), |
34 censorable=True, | 34 censorable=True, |
35 canonical_parent_order=False, # see comment in revlog.py | |
35 ) | 36 ) |
36 # Full name of the user visible file, relative to the repository root. | 37 # Full name of the user visible file, relative to the repository root. |
37 # Used by LFS. | 38 # Used by LFS. |
38 self._revlog.filename = path | 39 self._revlog.filename = path |
39 self.nullid = self._revlog.nullid | 40 self.nullid = self._revlog.nullid |
205 return len(self.read(node)) | 206 return len(self.read(node)) |
206 if self.iscensored(rev): | 207 if self.iscensored(rev): |
207 return 0 | 208 return 0 |
208 | 209 |
209 # XXX if self.read(node).startswith("\1\n"), this returns (size+4) | 210 # XXX if self.read(node).startswith("\1\n"), this returns (size+4) |
211 # XXX See also basefilectx.cmp. | |
210 return self._revlog.size(rev) | 212 return self._revlog.size(rev) |
211 | 213 |
212 def cmp(self, node, text): | 214 def cmp(self, node, text): |
213 """compare text with a given file revision | 215 """compare text with a given file revision |
214 | 216 |