"""
# end of bup preamble
+from __future__ import absolute_import, print_function
from errno import EACCES
from io import BytesIO
import os, sys, stat, time, math
hostname, istty2, log, parse_date_or_fatal, parse_num,
path_components, progress, qprogress, resolve_parent,
saved_errors, stripped_path_components,
- userfullname, username)
+ userfullname, username, valid_save_name)
optspec = """
if is_reverse and opt.remote:
o.fatal("don't use -r in reverse mode; it's automatic")
-if opt.name and opt.name.startswith('.'):
+if opt.name and not valid_save_name(opt.name):
o.fatal("'%s' is not a valid branch name" % opt.name)
refname = opt.name and 'refs/heads/%s' % opt.name or None
if opt.remote or is_reverse:
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