mercurial/manifest.py
changeset 4159 a896607d3ec3
parent 3893 6b4127c7d52a
child 4266 1b5c38e9d7aa
equal deleted inserted replaced
4158:d8515e374204 4159:a896607d3ec3
   104         else:
   104         else:
   105             return (lo, lo)
   105             return (lo, lo)
   106 
   106 
   107     def find(self, node, f):
   107     def find(self, node, f):
   108         '''look up entry for a single file efficiently.
   108         '''look up entry for a single file efficiently.
   109         return (node, flag) pair if found, (None, None) if not.'''
   109         return (node, flags) pair if found, (None, None) if not.'''
   110         if self.mapcache and node == self.mapcache[0]:
   110         if self.mapcache and node == self.mapcache[0]:
   111             return self.mapcache[1].get(f), self.mapcache[1].flags(f)
   111             return self.mapcache[1].get(f), self.mapcache[1].flags(f)
   112         text = self.revision(node)
   112         text = self.revision(node)
   113         start, end = self._search(text, f)
   113         start, end = self._search(text, f)
   114         if start == end:
   114         if start == end:
   115             return None, None
   115             return None, None
   116         l = text[start:end]
   116         l = text[start:end]
   117         f, n = l.split('\0')
   117         f, n = l.split('\0')
   118         return bin(n[:40]), n[40:-1] == 'x'
   118         return bin(n[:40]), n[40:-1]
   119 
   119 
   120     def add(self, map, transaction, link, p1=None, p2=None,
   120     def add(self, map, transaction, link, p1=None, p2=None,
   121             changed=None):
   121             changed=None):
   122         # apply the changes collected during the bisect loop to our addlist
   122         # apply the changes collected during the bisect loop to our addlist
   123         # return a delta suitable for addrevision
   123         # return a delta suitable for addrevision