progress_callback = None
fanout = 16
-GIT_MODE_FILE = 0100644
-GIT_MODE_TREE = 040000
-GIT_MODE_SYMLINK = 0120000
-assert(GIT_MODE_TREE != 40000) # 0xxx should be treated as octal
+GIT_MODE_FILE = 0o100644
+GIT_MODE_TREE = 0o40000
+GIT_MODE_SYMLINK = 0o120000
# The purpose of this type of buffer is to avoid copying on peek(), get(),
# and eat(). We do copy the buffer contents on put(), but that should
@wvtest
def testmangle():
with no_lingering_errors():
- afile = 0100644
- afile2 = 0100770
- alink = 0120000
- adir = 0040000
- adir2 = 0040777
+ afile = 0o100644
+ afile2 = 0o100770
+ alink = 0o120000
+ adir = 0o040000
+ adir2 = 0o040777
WVPASSEQ(git.mangle_name("a", adir2, adir), "a")
WVPASSEQ(git.mangle_name(".bup", adir2, adir), ".bup.bupl")
WVPASSEQ(git.mangle_name("a.bupa", adir2, adir), "a.bupa.bupl")
os.mkdir(path)
m = metadata.from_path(path, archive_path=path, save_symlinks=True)
WVPASSEQ(m.path, path)
- os.chmod(path, 000)
+ os.chmod(path, 0o000)
metadata.from_path(path, archive_path=path, save_symlinks=True)
if metadata.get_linux_file_attr:
print >> sys.stderr, 'saved_errors:', helpers.saved_errors
clear_errors()
m = metadata.from_path(path, archive_path=path, save_symlinks=True)
WVPASSEQ(m.path, path)
- os.chmod(parent, 000)
+ os.chmod(parent, 0o000)
m.apply_to_path(path)
print >> sys.stderr, 'saved_errors:', helpers.saved_errors
expected_errors = ['utime: ']
class Symlink(File):
"""A symbolic link from bup's repository."""
def __init__(self, parent, name, hash, bupmode, repo_dir=None):
- File.__init__(self, parent, name, 0120000, hash, bupmode,
+ File.__init__(self, parent, name, 0o120000, hash, bupmode,
repo_dir = repo_dir)
def size(self):