The vfs.py library makes it possible to expose contents from bup's repository
and abstracts internal name mangling and storage from the exposition layer.
"""
+
import os, re, stat, time
+
from bup import git, metadata
-from helpers import *
+from helpers import debug1, debug2
from bup.git import BUP_NORMAL, BUP_CHUNKED, cp
from bup.hashsplit import GIT_MODE_TREE, GIT_MODE_FILE
self._bupm = File(self, mangled_name, GIT_MODE_FILE, sha,
bupmode)
continue
- (name,bupmode) = git.demangle_name(mangled_name)
+ name, bupmode = git.demangle_name(mangled_name, mode)
if bupmode == git.BUP_CHUNKED:
mode = GIT_MODE_FILE
if stat.S_ISDIR(mode):
repo_dir=self._repo_dir)[0]
commithex = sha.encode('hex')
target = '../.commit/%s/%s' % (commithex[:2], commithex[2:])
- tag1 = FakeSymlink(self, name, target, repo_dir, self._repo_dir)
+ tag1 = FakeSymlink(self, name, target, self._repo_dir)
tag1.ctime = tag1.mtime = date
self._subs[name] = tag1
def _mksubs(self):
self._subs = {}
- tags = git.tags(repo_dir = self._repo_dir)
-
revs = list(git.rev_list(self.hash.encode('hex'),
repo_dir=self._repo_dir))
latest = revs[0]
n1.ctime = n1.mtime = date
self._subs[ls] = n1
- for tag in tags.get(commit, []):
- t1 = FakeSymlink(self, tag, target, self._repo_dir)
- t1.ctime = t1.mtime = date
- self._subs[tag] = t1
-
(date, commit) = latest
commithex = commit.encode('hex')
target = '../.commit/%s/%s' % (commithex[:2], commithex[2:])