comparison mercurial/revlog.py @ 19060:c010cb6fdef7

revlog: fix a regression with null revision Introduced in the patch which fixes issue3497 Part of that patch was erroneously submitted and it shouldn't be in the code
author Alexander Plavin <me@aplavin.ru>
date Thu, 18 Apr 2013 16:46:09 +0400
parents c1af1fb314bc
children 4cfdec944edf
comparison
equal deleted inserted replaced
19059:53eadcb814fd 19060:c010cb6fdef7
769 prefix = bin(id[:l * 2]) 769 prefix = bin(id[:l * 2])
770 nl = [e[7] for e in self.index if e[7].startswith(prefix)] 770 nl = [e[7] for e in self.index if e[7].startswith(prefix)]
771 nl = [n for n in nl if hex(n).startswith(id)] 771 nl = [n for n in nl if hex(n).startswith(id)]
772 if len(nl) > 0: 772 if len(nl) > 0:
773 if len(nl) == 1: 773 if len(nl) == 1:
774 if nl[0] == nullid:
775 # dummy null revision always exists,
776 # it shouldn't be returned here
777 return None
778 self._pcache[id] = nl[0] 774 self._pcache[id] = nl[0]
779 return nl[0] 775 return nl[0]
780 raise LookupError(id, self.indexfile, 776 raise LookupError(id, self.indexfile,
781 _('ambiguous identifier')) 777 _('ambiguous identifier'))
782 return None 778 return None