##// END OF EJS Templates
revlog: tweak wording and logic for flags validation...
Gregory Szorc -
r32391:36d3559c default
parent child Browse files
Show More
@@ -328,15 +328,19 b' class revlog(object):'
328 self._generaldelta = v & FLAG_GENERALDELTA
328 self._generaldelta = v & FLAG_GENERALDELTA
329 flags = v & ~0xFFFF
329 flags = v & ~0xFFFF
330 fmt = v & 0xFFFF
330 fmt = v & 0xFFFF
331 if fmt == REVLOGV0 and flags:
331 if fmt == REVLOGV0:
332 raise RevlogError(_("index %s unknown flags %#04x for format v0")
332 if flags:
333 % (self.indexfile, flags >> 16))
333 raise RevlogError(_('unknown flags (%#04x) in version %d '
334 elif fmt == REVLOGV1 and flags & ~REVLOGV1_FLAGS:
334 'revlog %s') %
335 raise RevlogError(_("index %s unknown flags %#04x for revlogng")
335 (flags >> 16, fmt, self.indexfile))
336 % (self.indexfile, flags >> 16))
336 elif fmt == REVLOGV1:
337 elif fmt > REVLOGV1:
337 if flags & ~REVLOGV1_FLAGS:
338 raise RevlogError(_("index %s unknown format %d")
338 raise RevlogError(_('unknown flags (%#04x) in version %d '
339 % (self.indexfile, fmt))
339 'revlog %s') %
340 (flags >> 16, fmt, self.indexfile))
341 else:
342 raise RevlogError(_('unknown version (%d) in revlog %s') %
343 (fmt, self.indexfile))
340
344
341 self.storedeltachains = True
345 self.storedeltachains = True
342
346
@@ -5,7 +5,7 b''
5 $ hg commit -m test
5 $ hg commit -m test
6 $ rm .hg/requires
6 $ rm .hg/requires
7 $ hg tip
7 $ hg tip
8 abort: index 00changelog.i unknown format 2!
8 abort: unknown version (2) in revlog 00changelog.i!
9 [255]
9 [255]
10 $ echo indoor-pool > .hg/requires
10 $ echo indoor-pool > .hg/requires
11 $ hg tip
11 $ hg tip
@@ -7,7 +7,7 b' Flags on revlog version 0 are rejected'
7 ... fh.write('\x00\x01\x00\x00')
7 ... fh.write('\x00\x01\x00\x00')
8
8
9 $ hg log
9 $ hg log
10 abort: index 00changelog.i unknown flags 0x01 for format v0!
10 abort: unknown flags (0x01) in version 0 revlog 00changelog.i!
11 [255]
11 [255]
12
12
13 Unknown flags on revlog version 1 are rejected
13 Unknown flags on revlog version 1 are rejected
@@ -16,7 +16,7 b' Unknown flags on revlog version 1 are re'
16 ... fh.write('\x00\x04\x00\x01')
16 ... fh.write('\x00\x04\x00\x01')
17
17
18 $ hg log
18 $ hg log
19 abort: index 00changelog.i unknown flags 0x04 for revlogng!
19 abort: unknown flags (0x04) in version 1 revlog 00changelog.i!
20 [255]
20 [255]
21
21
22 Unknown version is rejected
22 Unknown version is rejected
@@ -25,7 +25,7 b' Unknown version is rejected'
25 ... fh.write('\x00\x00\x00\x02')
25 ... fh.write('\x00\x00\x00\x02')
26
26
27 $ hg log
27 $ hg log
28 abort: index 00changelog.i unknown format 2!
28 abort: unknown version (2) in revlog 00changelog.i!
29 [255]
29 [255]
30
30
31 $ cd ..
31 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now