comparison mercurial/revlog.py @ 47134:1b33e38d4b6d

revlog: highlight current incompatibility in `rewrite_sidedata` See comment for details. We will need to fix the test coverage when this incompatibility is lifted. Differential Revision: https://phab.mercurial-scm.org/D10544
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:18:58 +0200
parents 5e5fad5166e6
children 84b176ad2860
comparison
equal deleted inserted replaced
47133:5e5fad5166e6 47134:1b33e38d4b6d
3080 assert not self._inline 3080 assert not self._inline
3081 if not helpers[1] and not helpers[2]: 3081 if not helpers[1] and not helpers[2]:
3082 # Nothing to generate or remove 3082 # Nothing to generate or remove
3083 return 3083 return
3084 3084
3085 # changelog implement some "delayed" writing mechanism that assume that
3086 # all index data is writen in append mode and is therefor incompatible
3087 # with the seeked write done in this method. The use of such "delayed"
3088 # writing will soon be removed for revlog version that support side
3089 # data, so for now, we only keep this simple assert to highlight the
3090 # situation.
3091 delayed = getattr(self, '_delayed', False)
3092 diverted = getattr(self, '_divert', False)
3093 if delayed and not diverted:
3094 msg = "cannot rewrite_sidedata of a delayed revlog"
3095 raise error.ProgrammingError(msg)
3096
3085 new_entries = [] 3097 new_entries = []
3086 # append the new sidedata 3098 # append the new sidedata
3087 with self._datafp(b'a+') as fp: 3099 with self._datafp(b'a+') as fp:
3088 # Maybe this bug still exists, see revlog._writeentry 3100 # Maybe this bug still exists, see revlog._writeentry
3089 fp.seek(0, os.SEEK_END) 3101 fp.seek(0, os.SEEK_END)