Mercurial > hg
comparison mercurial/repocache.py @ 51106:d83d788590a8
changelog-delay: move the delay/divert logic inside the (inner) revlog
Instead of hacking throught the vfs/opener, we implement the delay/divert logic
inside the `_InnerRevlog` and `randomaccessfile` object. This will allow to an
alternative implementation of the `_InnerRevlog` that does not need to use Python details.
As a result, the new implementation can use the transaction less agressively
and avoid some extra output since no data had been written yet. That seems like
a good side effect.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 24 Oct 2023 11:08:49 +0200 |
parents | 642e31cb55f0 |
children | 630d5283ee82 |
comparison
equal
deleted
inserted
replaced
51105:af96fbb8f739 | 51106:d83d788590a8 |
---|---|
127 """Copy cached attributes from srcrepo to destrepo""" | 127 """Copy cached attributes from srcrepo to destrepo""" |
128 destfilecache = destrepo._filecache | 128 destfilecache = destrepo._filecache |
129 srcfilecache = srcrepo._filecache | 129 srcfilecache = srcrepo._filecache |
130 if b'changelog' in srcfilecache: | 130 if b'changelog' in srcfilecache: |
131 destfilecache[b'changelog'] = ce = srcfilecache[b'changelog'] | 131 destfilecache[b'changelog'] = ce = srcfilecache[b'changelog'] |
132 ce.obj.opener = ce.obj._realopener = destrepo.svfs | 132 ce.obj.opener = ce.obj._inner.opener = destrepo.svfs |
133 if b'obsstore' in srcfilecache: | 133 if b'obsstore' in srcfilecache: |
134 destfilecache[b'obsstore'] = ce = srcfilecache[b'obsstore'] | 134 destfilecache[b'obsstore'] = ce = srcfilecache[b'obsstore'] |
135 ce.obj.svfs = destrepo.svfs | 135 ce.obj.svfs = destrepo.svfs |
136 if b'_phasecache' in srcfilecache: | 136 if b'_phasecache' in srcfilecache: |
137 destfilecache[b'_phasecache'] = ce = srcfilecache[b'_phasecache'] | 137 destfilecache[b'_phasecache'] = ce = srcfilecache[b'_phasecache'] |