comparison mercurial/context.py @ 9974:da5209afe1bc

context: parents() already filters nullid
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 01 Dec 2009 01:08:16 +0100
parents d1319ad5071b
children 24ce8f0c0a39
comparison
equal deleted inserted replaced
9973:d1319ad5071b 9974:da5209afe1bc
437 437
438 hist = {} 438 hist = {}
439 for f in sorted(visit, key=lambda x: x.rev()): 439 for f in sorted(visit, key=lambda x: x.rev()):
440 curr = decorate(f.data(), f) 440 curr = decorate(f.data(), f)
441 for p in parents(f): 441 for p in parents(f):
442 if p != nullid: 442 curr = pair(hist[p], curr)
443 curr = pair(hist[p], curr) 443 # trim the history of unneeded revs
444 # trim the history of unneeded revs 444 needed[p] -= 1
445 needed[p] -= 1 445 if not needed[p]:
446 if not needed[p]: 446 del hist[p]
447 del hist[p]
448 hist[f] = curr 447 hist[f] = curr
449 448
450 return zip(hist[f][0], hist[f][1].splitlines(True)) 449 return zip(hist[f][0], hist[f][1].splitlines(True))
451 450
452 def ancestor(self, fc2): 451 def ancestor(self, fc2):