Esempio n. 1
0
File: vfs.py Progetto: huerlisi/bup
 def _mksubs(self):
     self._subs = {}
     it = cp().get(self.hash.encode('hex'))
     type = it.next()
     if type == 'commit':
         del it
         it = cp().get(self.hash.encode('hex') + ':')
         type = it.next()
     assert(type == 'tree')
     for (mode,mangled_name,sha) in git.treeparse(''.join(it)):
         mode = int(mode, 8)
         name = mangled_name
         (name,bupmode) = git.demangle_name(mangled_name)
         if bupmode == git.BUP_CHUNKED:
             mode = 0100644
         if stat.S_ISDIR(mode):
             self._subs[name] = Dir(self, name, mode, sha)
         elif stat.S_ISLNK(mode):
             self._subs[name] = Symlink(self, name, sha, bupmode)
         else:
             self._subs[name] = File(self, name, mode, sha, bupmode)
Esempio n. 2
0
File: vfs.py Progetto: huerlisi/bup
def _treeget(hash):
    it = cp().get(hash.encode('hex'))
    type = it.next()
    assert(type == 'tree')
    return git.treeparse(''.join(it))