コード例 #1
0
 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
コード例 #2
0
ファイル: filelog.py プロジェクト: chuchiperriman/hg-stable
 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
コード例 #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
コード例 #4
0
ファイル: manifest.py プロジェクト: CSCI-362-02-2015/RedTeam
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), ''
コード例 #5
0
ファイル: manifest.py プロジェクト: pierfort123/mercurial
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), ''
コード例 #6
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]
コード例 #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]