def renamed(self, node):
     if self.parents(node)[0] != revlog.nullid:
         return False
     m = self._readmeta(node)
     if m and "copy" in m:
         return (m["copy"], revlog.bin(m["copyrev"]))
     return False
Example #2
0
 def renamed(self, node):
     if self.parents(node)[0] != revlog.nullid:
         return False
     t = self.revision(node)
     m = _parsemeta(t)[0]
     if m and "copy" in m:
         return (m["copy"], revlog.bin(m["copyrev"]))
     return False
Example #3
0
 def renamed(self, node):
     if self.parents(node)[0] != revlog.nullid:
         return False
     t = self.revision(node)
     m = _parsemeta(t)[0]
     if m and "copy" in m:
         return (m["copy"], revlog.bin(m["copyrev"]))
     return False
Example #4
0
def _parsev1(data):
    # This method does a little bit of excessive-looking
    # precondition checking. This is so that the behavior of this
    # class exactly matches its C counterpart to try and help
    # prevent surprise breakage for anyone that develops against
    # the pure version.
    if data and data[-1] != '\n':
        raise ValueError('Manifest did not end in a newline.')
    prev = None
    for l in data.splitlines():
        if prev is not None and prev > l:
            raise ValueError('Manifest lines not in sorted order.')
        prev = l
        f, n = l.split('\0')
        if len(n) > 40:
            yield f, revlog.bin(n[:40]), n[40:]
        else:
            yield f, revlog.bin(n), ''
Example #5
0
def _parsev1(data):
    # This method does a little bit of excessive-looking
    # precondition checking. This is so that the behavior of this
    # class exactly matches its C counterpart to try and help
    # prevent surprise breakage for anyone that develops against
    # the pure version.
    if data and data[-1] != '\n':
        raise ValueError('Manifest did not end in a newline.')
    prev = None
    for l in data.splitlines():
        if prev is not None and prev > l:
            raise ValueError('Manifest lines not in sorted order.')
        prev = l
        f, n = l.split('\0')
        if len(n) > 40:
            yield f, revlog.bin(n[:40]), n[40:]
        else:
            yield f, revlog.bin(n), ''
 def find(self, node, f):
     '''look up entry for a single file efficiently.
     return (node, flags) pair if found, (None, None) if not.'''
     if self._mancache and self._mancache[0] == node:
         return self._mancache[1].get(f), self._mancache[1].flags(f)
     text = self.revision(node)
     start, end = self._search(text, f)
     if start == end:
         return None, None
     l = text[start:end]
     f, n = l.split('\0')
     return revlog.bin(n[:40]), n[40:-1]
Example #7
0
 def find(self, node, f):
     '''look up entry for a single file efficiently.
     return (node, flags) pair if found, (None, None) if not.'''
     if self._mancache and self._mancache[0] == node:
         return self._mancache[1].get(f), self._mancache[1].flags(f)
     text = self.revision(node)
     start, end = self._search(text, f)
     if start == end:
         return None, None
     l = text[start:end]
     f, n = l.split('\0')
     return revlog.bin(n[:40]), n[40:-1]