##// END OF EJS Templates
manifest: use the same logic for handling flags in _parse as elsewhere...
Joerg Sonnenberger -
r45679:19748c73 default
parent child Browse files
Show More
@@ -58,14 +58,16 b' def _parse(data):'
58 prev = l
58 prev = l
59 f, n = l.split(b'\0')
59 f, n = l.split(b'\0')
60 nl = len(n)
60 nl = len(n)
61 if 64 < nl:
61 flags = n[-1:]
62 # modern hash, full width
62 if flags in _manifestflags:
63 yield f, bin(n[:64]), n[64:]
63 n = n[:-1]
64 elif 40 < nl < 45:
64 nl -= 1
65 # legacy hash, always sha1
66 yield f, bin(n[:40]), n[40:]
67 else:
65 else:
68 yield f, bin(n), b''
66 flags = b''
67 if nl not in (40, 64):
68 raise ValueError(b'Invalid manifest line')
69
70 yield f, bin(n), flags
69
71
70
72
71 def _text(it):
73 def _text(it):
General Comments 0
You need to be logged in to leave comments. Login now