mercurial/revlog.py
changeset 19060 c010cb6fdef7
parent 18991 c1af1fb314bc
child 19200 4cfdec944edf
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