"""
# end of bup preamble
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
from errno import EACCES
from io import BytesIO
import os, sys, stat, time, math
else:
return dir
-
# Metadata is stored in a file named .bupm in each directory. The
# first metadata entry will be the metadata for the current directory.
# The remaining entries will be for each of the other directory
dir_name, fs_path = path_component
# Not indexed, so just grab the FS metadata or use empty metadata.
try:
- meta = metadata.from_path(fs_path) if fs_path else metadata.Metadata()
+ meta = metadata.from_path(fs_path, normalized=True) \
+ if fs_path else metadata.Metadata()
except (OSError, IOError) as e:
add_error(e)
lastskip_name = dir_name
sort_key = git.shalist_item_sort_key((ent.mode, file, id))
hlink = find_hardlink_target(hlink_db, ent)
try:
- meta = metadata.from_path(ent.name, hardlink_target=hlink)
+ meta = metadata.from_path(ent.name, hardlink_target=hlink,
+ normalized=True)
except (OSError, IOError) as e:
add_error(e)
lastskip_name = ent.name
dir_metadata = metadata.Metadata() if root_collision else None)
if opt.tree:
- print tree.encode('hex')
+ print(tree.encode('hex'))
if opt.commit or opt.name:
msg = 'bup save\n\nGenerated by command:\n%r\n' % sys.argv
userline = '%s <%s@%s>' % (userfullname(), username(), hostname())
commit = w.new_commit(tree, oldref, userline, date, None,
userline, date, None, msg)
if opt.commit:
- print commit.encode('hex')
+ print(commit.encode('hex'))
msr.close()
w.close() # must close before we can update the ref