comparison mercurial/revlog.py @ 18991:c1af1fb314bc

log: fix behavior with empty repositories (issue3497) Make output in this special case consistent with general case one.
author Alexander Plavin <me@aplavin.ru>
date Wed, 17 Apr 2013 00:29:54 +0400
parents 12a3474c1634
children c010cb6fdef7
comparison
equal deleted inserted replaced
18990:7373be706f02 18991:c1af1fb314bc
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
774 self._pcache[id] = nl[0] 778 self._pcache[id] = nl[0]
775 return nl[0] 779 return nl[0]
776 raise LookupError(id, self.indexfile, 780 raise LookupError(id, self.indexfile,
777 _('ambiguous identifier')) 781 _('ambiguous identifier'))
778 return None 782 return None