comparison mercurial/revlog.py @ 43039:7902001aaf41

sidedata: make sure we don't use the flag if there are not sidedata Ensuring this at this level seems safer than relying on caller doing the right thing. G: changed mercurial/revlog.py Differential Revision: https://phab.mercurial-scm.org/D6895
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 27 Sep 2019 16:40:07 +0200
parents 7bb5a2465501
children 2372284d9457
comparison
equal deleted inserted replaced
43038:7bb5a2465501 43039:7902001aaf41
1859 raise error.RevlogError(_("attempted to add linkrev -1 to %s") 1859 raise error.RevlogError(_("attempted to add linkrev -1 to %s")
1860 % self.indexfile) 1860 % self.indexfile)
1861 1861
1862 if sidedata is None: 1862 if sidedata is None:
1863 sidedata = {} 1863 sidedata = {}
1864 flags = flags & ~REVIDX_SIDEDATA
1864 elif not self.hassidedata: 1865 elif not self.hassidedata:
1865 raise error.ProgrammingError( 1866 raise error.ProgrammingError(
1866 _("trying to add sidedata to a revlog who don't support them") 1867 _("trying to add sidedata to a revlog who don't support them")
1867 ) 1868 )
1868 else: 1869 else: