##// END OF EJS Templates
revlog: move size limit check to addrevision...
Matt Mackall -
r25459:0bda5bfa default
parent child Browse files
Show More
@@ -167,12 +167,6 class revlogio(object):
167 return index, getattr(index, 'nodemap', None), cache
167 return index, getattr(index, 'nodemap', None), cache
168
168
169 def packentry(self, entry, node, version, rev):
169 def packentry(self, entry, node, version, rev):
170 uncompressedlength = entry[2]
171 if uncompressedlength > _maxentrysize:
172 raise RevlogError(
173 _("size of %d bytes exceeds maximum revlog storage of 2GiB")
174 % uncompressedlength)
175
176 p = _pack(indexformatng, *entry)
170 p = _pack(indexformatng, *entry)
177 if rev == 0:
171 if rev == 0:
178 p = _pack(versionformat, version) + p[4:]
172 p = _pack(versionformat, version) + p[4:]
@@ -1190,6 +1184,12 class revlog(object):
1190 if link == nullrev:
1184 if link == nullrev:
1191 raise RevlogError(_("attempted to add linkrev -1 to %s")
1185 raise RevlogError(_("attempted to add linkrev -1 to %s")
1192 % self.indexfile)
1186 % self.indexfile)
1187
1188 if len(text) > _maxentrysize:
1189 raise RevlogError(
1190 _("%s: size of %d bytes exceeds maximum revlog storage of 2GiB")
1191 % (self.indexfile, len(text)))
1192
1193 node = node or self.hash(text, p1, p2)
1193 node = node or self.hash(text, p1, p2)
1194 if node in self.nodemap:
1194 if node in self.nodemap:
1195 return node
1195 return node
General Comments 0
You need to be logged in to leave comments. Login now