Mercurial > hg
comparison mercurial/revlog.py @ 39143:65d5de1169dd
revlog: fix pure nodemap to not access missing index entry
This bug was revealed by a3dacabd476b and a1f934573c0b.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 17 Aug 2018 12:54:50 +0900 |
parents | f90b333e79cb |
children | 5f924aa0567c |
comparison
equal
deleted
inserted
replaced
39142:13a1901176f1 | 39143:65d5de1169dd |
---|---|
1105 stop = length | 1105 stop = length |
1106 return pycompat.xrange(start, stop, step) | 1106 return pycompat.xrange(start, stop, step) |
1107 | 1107 |
1108 @util.propertycache | 1108 @util.propertycache |
1109 def nodemap(self): | 1109 def nodemap(self): |
1110 self.rev(self.node(0)) | 1110 if self.index: |
1111 # populate mapping down to the initial node | |
1112 self.rev(self.node(0)) | |
1111 return self._nodecache | 1113 return self._nodecache |
1112 | 1114 |
1113 def hasnode(self, node): | 1115 def hasnode(self, node): |
1114 try: | 1116 try: |
1115 self.rev(node) | 1117 self.rev(node) |