comparison mercurial/revlog.py @ 655:b3bba126b04a

Fix out of range regression -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fix out of range regression From: Filip Brcic <brcha@users.sourceforge.net> The old revlog.py issued "index out of range" error when cloning the repository Now I have reverted the parts of revlog.py to the old state when prev was initialized as -1 and later assigned self.tip() only if that is possible. Previously prev was always initialized as self.tip() and that is where the out of range error was. manifest hash: c94c9aee8b6d382ef52c3981f306a6e7e5f4c4d1 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCzzIxywK+sNU5EO8RAtlcAJ0TX9FXuC2c3YHuYXNwqZhdzPWUlgCggq+a yJzUKDKH/gvnD3Tx3jcmCn8= =euPi -----END PGP SIGNATURE-----
author Matt Mackall <mpm@selenic.com>
date Fri, 08 Jul 2005 18:10:57 -0800
parents 94cdd02792b5
children 473c030d34a6 c2e77581bc84
comparison
equal deleted inserted replaced
654:fafc16f705b6 655:b3bba126b04a
473 # track the base of the current delta log 473 # track the base of the current delta log
474 r = self.count() 474 r = self.count()
475 t = r - 1 475 t = r - 1
476 node = nullid 476 node = nullid
477 477
478 base = -1 478 base = prev = -1
479 start = end = measure = 0 479 start = end = measure = 0
480 if r: 480 if r:
481 start = self.start(self.base(t)) 481 start = self.start(self.base(t))
482 end = self.end(t) 482 end = self.end(t)
483 measure = self.length(self.base(t)) 483 measure = self.length(self.base(t))
489 dfh = self.opener(self.datafile, "a") 489 dfh = self.opener(self.datafile, "a")
490 ifh = self.opener(self.indexfile, "a") 490 ifh = self.opener(self.indexfile, "a")
491 491
492 # loop through our set of deltas 492 # loop through our set of deltas
493 chain = None 493 chain = None
494 prev = self.tip()
495 for chunk in revs: 494 for chunk in revs:
496 node, p1, p2, cs = struct.unpack("20s20s20s20s", chunk[:80]) 495 node, p1, p2, cs = struct.unpack("20s20s20s20s", chunk[:80])
497 link = linkmapper(cs) 496 link = linkmapper(cs)
498 if node in self.nodemap: 497 if node in self.nodemap:
499 # this can happen if two branches make the same change 498 # this can happen if two branches make the same change