##// END OF EJS Templates
manifest: fix yet another 20-byte-hash assumption...
Augie Fackler -
r45195:75f1197d default
parent child Browse files
Show More
@@ -292,8 +292,13 b' class _lazymanifest(object):'
292 292 b"Manifest values must be a tuple of (node, flags)."
293 293 )
294 294 hashval = value[0]
295 if not isinstance(hashval, bytes) or not 20 <= len(hashval) <= 22:
296 raise TypeError(b"node must be a 20-byte byte string")
295 # hashes are either 20 or 32 bytes (sha1 or its replacement),
296 # and allow one extra byte taht won't be persisted to disk but
297 # is sometimes used in memory.
298 if not isinstance(hashval, bytes) or not (
299 20 <= len(hashval) <= 22 or 32 <= len(hashval) <= 34
300 ):
301 raise TypeError(b"node must be a 20-byte or 32-byte byte string")
297 302 flags = value[1]
298 303 if len(hashval) == 22:
299 304 hashval = hashval[:-1]
General Comments 0
You need to be logged in to leave comments. Login now