##// END OF EJS Templates
lookup: fast-paths for int and 'tip'
Matt Mackall -
r7377:374a6b3a default
parent child Browse files
Show More
@@ -437,10 +437,14 b' class localrepository(repo.repository):'
437 partial[b] = c.node()
437 partial[b] = c.node()
438
438
439 def lookup(self, key):
439 def lookup(self, key):
440 if key == '.':
440 if isinstance(key, int):
441 return self.changelog.node(key)
442 elif key == '.':
441 return self.dirstate.parents()[0]
443 return self.dirstate.parents()[0]
442 elif key == 'null':
444 elif key == 'null':
443 return nullid
445 return nullid
446 elif key == 'tip':
447 return self.changelog.tip()
444 n = self.changelog._match(key)
448 n = self.changelog._match(key)
445 if n:
449 if n:
446 return n
450 return n
General Comments 0
You need to be logged in to leave comments. Login now