Show More
@@ -11,7 +11,7 b' from demandload import demandload' | |||
|
11 | 11 | demandload(globals(), "os time util") |
|
12 | 12 | |
|
13 | 13 | class changelog(revlog): |
|
14 | def __init__(self, opener, defversion=0): | |
|
14 | def __init__(self, opener, defversion=REVLOGV0): | |
|
15 | 15 | revlog.__init__(self, opener, "00changelog.i", "00changelog.d", |
|
16 | 16 | defversion) |
|
17 | 17 |
@@ -42,7 +42,7 b' class localrepository(object):' | |||
|
42 | 42 | pass |
|
43 | 43 | |
|
44 | 44 | v = self.ui.revlogopts |
|
45 | self.revlogversion = int(v.get('format', 0)) | |
|
45 | self.revlogversion = int(v.get('format', revlog.REVLOGV0)) | |
|
46 | 46 | flags = 0 |
|
47 | 47 | for x in v.get('flags', "").split(): |
|
48 | 48 | flags |= revlog.flagstr(x) |
@@ -12,7 +12,7 b' from demandload import *' | |||
|
12 | 12 | demandload(globals(), "bisect array") |
|
13 | 13 | |
|
14 | 14 | class manifest(revlog): |
|
15 | def __init__(self, opener, defversion=0): | |
|
15 | def __init__(self, opener, defversion=REVLOGV0): | |
|
16 | 16 | self.mapcache = None |
|
17 | 17 | self.listcache = None |
|
18 | 18 | revlog.__init__(self, opener, "00manifest.i", "00manifest.d", |
@@ -293,7 +293,7 b' class revlog(object):' | |||
|
293 | 293 | remove data, and can use some simple techniques to avoid the need |
|
294 | 294 | for locking while reading. |
|
295 | 295 | """ |
|
296 | def __init__(self, opener, indexfile, datafile, defversion=0): | |
|
296 | def __init__(self, opener, indexfile, datafile, defversion=REVLOGV0): | |
|
297 | 297 | """ |
|
298 | 298 | create a revlog object |
|
299 | 299 | |
@@ -337,7 +337,7 b' class revlog(object):' | |||
|
337 | 337 | v = struct.unpack(versionformat, i)[0] |
|
338 | 338 | flags = v & ~0xFFFF |
|
339 | 339 | fmt = v & 0xFFFF |
|
340 | if fmt == 0: | |
|
340 | if fmt == REVLOGV0: | |
|
341 | 341 | if flags: |
|
342 | 342 | raise RevlogError(_("index %s invalid flags %x for format v0" % |
|
343 | 343 | (self.indexfile, flags))) |
@@ -349,7 +349,7 b' class revlog(object):' | |||
|
349 | 349 | raise RevlogError(_("index %s invalid format %d" % |
|
350 | 350 | (self.indexfile, fmt))) |
|
351 | 351 | self.version = v |
|
352 | if v == 0: | |
|
352 | if v == REVLOGV0: | |
|
353 | 353 | self.indexformat = indexformatv0 |
|
354 | 354 | shaoffset = v0shaoffset |
|
355 | 355 | else: |
@@ -369,7 +369,7 b' class revlog(object):' | |||
|
369 | 369 | # we've already got the entire data file read in, save it |
|
370 | 370 | # in the chunk data |
|
371 | 371 | self.chunkcache = (0, i) |
|
372 | if self.version != 0: | |
|
372 | if self.version != REVLOGV0: | |
|
373 | 373 | e = list(self.index[0]) |
|
374 | 374 | type = self.ngtype(e[0]) |
|
375 | 375 | e[0] = self.offset_type(0, type) |
@@ -441,13 +441,13 b' class revlog(object):' | |||
|
441 | 441 | if node == nullid: return (nullid, nullid) |
|
442 | 442 | r = self.rev(node) |
|
443 | 443 | d = self.index[r][-3:-1] |
|
444 | if self.version == 0: | |
|
444 | if self.version == REVLOGV0: | |
|
445 | 445 | return d |
|
446 | 446 | return [ self.node(x) for x in d ] |
|
447 | 447 | def start(self, rev): |
|
448 | 448 | if rev < 0: |
|
449 | 449 | return -1 |
|
450 | if self.version != 0: | |
|
450 | if self.version != REVLOGV0: | |
|
451 | 451 | return self.ngoffset(self.index[rev][0]) |
|
452 | 452 | return self.index[rev][0] |
|
453 | 453 | |
@@ -456,7 +456,7 b' class revlog(object):' | |||
|
456 | 456 | def size(self, rev): |
|
457 | 457 | """return the length of the uncompressed text for a given revision""" |
|
458 | 458 | l = -1 |
|
459 | if self.version != 0: | |
|
459 | if self.version != REVLOGV0: | |
|
460 | 460 | l = self.index[rev][2] |
|
461 | 461 | if l >= 0: |
|
462 | 462 | return l |
@@ -911,7 +911,7 b' class revlog(object):' | |||
|
911 | 911 | if t >= 0: |
|
912 | 912 | offset = self.end(t) |
|
913 | 913 | |
|
914 | if self.version == 0: | |
|
914 | if self.version == REVLOGV0: | |
|
915 | 915 | e = (offset, l, base, link, p1, p2, node) |
|
916 | 916 | else: |
|
917 | 917 | e = (self.offset_type(offset, 0), l, len(text), |
@@ -935,7 +935,7 b' class revlog(object):' | |||
|
935 | 935 | f.seek(0, 2) |
|
936 | 936 | transaction.add(self.indexfile, f.tell(), self.count() - 1) |
|
937 | 937 | |
|
938 | if len(self.index) == 1 and self.version != 0: | |
|
938 | if len(self.index) == 1 and self.version != REVLOGV0: | |
|
939 | 939 | l = struct.pack(versionformat, self.version) |
|
940 | 940 | f.write(l) |
|
941 | 941 | entry = entry[4:] |
@@ -1135,7 +1135,7 b' class revlog(object):' | |||
|
1135 | 1135 | raise RevlogError(_("consistency error adding group")) |
|
1136 | 1136 | textlen = len(text) |
|
1137 | 1137 | else: |
|
1138 | if self.version == 0: | |
|
1138 | if self.version == REVLOGV0: | |
|
1139 | 1139 | e = (end, len(cdelta), base, link, p1, p2, node) |
|
1140 | 1140 | else: |
|
1141 | 1141 | e = (self.offset_type(end, 0), len(cdelta), textlen, base, |
General Comments 0
You need to be logged in to leave comments.
Login now