(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
- o.fatal('no positional parameters expected')
+ o.fatal('No positional parameters expected')
git.check_repo_or_die()
if not opt.check and opt.k and opt.k not in (4,5):
- o.fatal('only k values of 4 and 5 are supported')
+ o.fatal('Only k values of 4 and 5 are supported')
paths = opt.dir and [opt.dir] or git.all_packdirs()
for path in paths:
top = vfs.RefList(None)
if not extra:
- o.fatal('must specify a target')
+ o.fatal('Must specify a target')
if len(extra) > 1:
- o.fatal('only one target file allowed')
+ o.fatal('Only one target file allowed')
if opt.bupm and opt.meta:
- o.fatal('--meta and --bupm are incompatible')
-
+ o.fatal('Options "--meta" and "--bupm" are incompatible')
+
target = extra[0]
if not re.match(r'/*[^/]+/[^/]+', target):
- o.fatal("path %r doesn't include a branch and revision" % target)
+ o.fatal("Path %r doesn't include a branch and revision" % target)
try:
n = top.lresolve(target)
if opt.bupm:
if not stat.S_ISDIR(n.mode):
- o.fatal('%r is not a directory' % target)
+ o.fatal('"%r" is not a directory' % target)
mfile = n.metadata_file() # VFS file -- cannot close().
if mfile:
meta_stream = mfile.open()
(opt, flags, extra) = o.parse(sys.argv[1:])
if not extra:
- o.fatal('filenames expected')
+ o.fatal('Filenames expected')
if opt.seed != None:
random.seed(opt.seed)
(opt, flags, extra) = o.parse(sys.argv[1:])
if len(extra) != 1:
- o.fatal("exactly one filename expected")
+ o.fatal("Exactly one filename expected")
drecurse_top = extra[0]
excluded_paths = parse_excludes(flags, o.fatal)
(opt, flags, extra) = o.parse(sys.argv[1:])
if len(extra) != 1:
- o.fatal("exactly one argument expected")
+ o.fatal("Exactly one argument expected")
git.check_repo_or_die()
top = vfs.RefList(None)
sys.stderr.write('Unable to run man command: %s\n' % e)
sys.exit(1)
else:
- o.fatal("exactly one command name expected")
+ o.fatal("Exactly one command name expected")
if opt.fake_valid and opt.fake_invalid:
o.fatal('--fake-valid is incompatible with --fake-invalid')
if opt.clear and opt.indexfile:
- o.fatal('cannot clear an external index (via -f)')
+ o.fatal('Cannot clear an external index (via -f)')
# FIXME: remove this once we account for timestamp races, i.e. index;
# touch new-file; index. It's possible for this to happen quickly
if opt.update:
if not extra:
- o.fatal('update mode (-u) requested but no paths given')
+ o.fatal('Update mode (-u) requested but no paths given')
for (rp,path) in paths:
update_index(rp, excluded_paths, exclude_rxs)
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
- o.fatal("no arguments expected")
+ o.fatal("No arguments expected")
try:
opt.find = opt.find or ''
if not extra:
- o.fatal('you must provide at least one filename')
+ o.fatal('You must provide at least one filename')
if len(opt.find) > 40:
o.fatal('--find parameter must be <= 40 chars long')
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
- o.fatal("no arguments expected")
+ o.fatal("No arguments expected")
git.check_repo_or_die()
git.ignore_midx = opt.ignore_midx
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
- o.fatal('no arguments expected')
+ o.fatal('No arguments expected')
git.ignore_midx = opt.ignore_midx
opt.start_extract, opt.finish_extract,
opt.edit]])
if action_count > 1:
- o.fatal("bup: only one action permitted: --create --list --extract --edit")
+ o.fatal("Only one action permitted: --create --list --extract --edit")
if action_count == 0:
- o.fatal("bup: no action specified")
+ o.fatal("No action specified")
if opt.create:
if len(remainder) < 1:
- o.fatal("no paths specified for create")
+ o.fatal("No paths specified for create")
output_file = open_output(opt.file)
metadata.save_tree(output_file,
remainder,
xdev=opt.xdev)
elif opt.list:
if len(remainder) > 0:
- o.fatal("cannot specify paths for --list")
+ o.fatal("Cannot specify paths for --list")
src = open_input(opt.file)
metadata.display_archive(src)
elif opt.start_extract:
if len(remainder) > 0:
- o.fatal("cannot specify paths for --start-extract")
+ o.fatal("Cannot specify paths for --start-extract")
src = open_input(opt.file)
metadata.start_extract(src, create_symlinks=opt.symlinks)
elif opt.finish_extract:
if len(remainder) > 0:
- o.fatal("cannot specify paths for --finish-extract")
+ o.fatal("Cannot specify paths for --finish-extract")
src = open_input(opt.file)
metadata.finish_extract(src, restore_numeric_ids=opt.numeric_ids)
elif opt.extract:
if len(remainder) > 0:
- o.fatal("cannot specify paths for --extract")
+ o.fatal("Cannot specify paths for --extract")
src = open_input(opt.file)
metadata.extract(src,
restore_numeric_ids=opt.numeric_ids,
create_symlinks=opt.symlinks)
elif opt.edit:
if len(remainder) < 1:
- o.fatal("no paths specified for edit")
+ o.fatal("No paths specified for edit")
output_file = open_output(opt.file)
unset_user = False # True if --unset-user was the last relevant option.
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra and (opt.auto or opt.force):
- o.fatal("you can't use -f/-a and also provide filenames")
+ o.fatal("You can't use -f/-a and also provide filenames")
if opt.check and (not extra and not opt.auto):
- o.fatal("if using --check, you must provide filenames or -a")
+ o.fatal("If using --check, you must provide filenames or -a")
git.check_repo_or_die()
debug1('Multi-index: scanning %s ...' % path)
do_midx_dir(path)
else:
- o.fatal("you must use -f or -a or provide input filenames")
+ o.fatal("You must use -f or -a or provide input filenames")
if not check_saved_errors():
sys.exit(1)
o = options.Options(optspec)
(opt, flags, extra) = o.parse(sys.argv[1:])
if len(extra) < 1:
- o.fatal('command is required')
+ o.fatal('Command is required')
subcmd = extra
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
- o.fatal("no arguments expected")
+ o.fatal("No arguments expected")
r = re.compile(r'([\r\n])')
lastlen = 0
o = options.Options(optspec)
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
- o.fatal('no arguments expected')
+ o.fatal('No arguments expected')
# get the subcommand's argv.
# Normally we could just pass this on the command line, but since we'll often
o = options.Options(optspec, optfunc=getopt.getopt)
(opt, flags, extra) = o.parse(sys.argv[1:])
if len(extra) < 2:
- o.fatal('arguments expected')
+ o.fatal('Arguments expected')
class SigException(Exception):
def __init__(self, signum):
(opt, flags, extra) = o.parse(sys.argv[1:])
if len(extra) != 1:
- o.fatal("exactly one argument expected")
+ o.fatal("Exactly one argument expected")
total = parse_num(extra[0])
top = vfs.RefList(None)
if not extra:
- o.fatal('must specify at least one filename to restore')
-
+ o.fatal('Must specify at least one filename to restore')
+
exclude_rxs = parse_rx_excludes(flags, o.fatal)
owner_map = {}
git.check_repo_or_die()
if not (opt.tree or opt.commit or opt.name):
- o.fatal("use one or more of -t, -c, -n")
+ o.fatal("Use one or more of -t, -c, -n")
if not extra:
- o.fatal("no filenames given")
+ o.fatal("No filenames given")
opt.progress = (istty2 and not opt.quiet)
opt.smaller = parse_num(opt.smaller or 0)
if option == "--graft":
splitted_parameter = parameter.split('=')
if len(splitted_parameter) != 2:
- o.fatal("a graft point must be of the form old_path=new_path")
+ o.fatal("A graft point must be of the form old_path=new_path")
old_path, new_path = splitted_parameter
if not (old_path and new_path):
- o.fatal("a graft point cannot be empty")
+ o.fatal("A graft point cannot be empty")
graft_points.append((realpath(old_path), realpath(new_path)))
is_reverse = os.environ.get('BUP_SERVER_REVERSE')
if is_reverse and opt.remote:
- o.fatal("don't use -r in reverse mode; it's automatic")
+ o.fatal("Don't use -r in reverse mode; it's automatic")
if opt.name and opt.name.startswith('.'):
o.fatal("'%s' is not a valid branch name" % opt.name)
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
- o.fatal('no arguments expected')
+ o.fatal('No arguments expected')
debug2('bup server: Reading from stdin.')
git.check_repo_or_die()
if not (opt.blobs or opt.tree or opt.commit or opt.name or
opt.noop or opt.copy):
- o.fatal("use one or more of -b, -t, -c, -n, --noop, --copy")
+ o.fatal("Use one or more of -b, -t, -c, -n, --noop, --copy")
if (opt.noop or opt.copy) and (opt.blobs or opt.tree or
opt.commit or opt.name):
o.fatal('--noop and --copy are incompatible with -b, -t, -c, -n')
if opt.blobs and (opt.tree or opt.commit or opt.name):
o.fatal('-b is incompatible with -t, -c, -n')
if extra and opt.git_ids:
- o.fatal("don't provide filenames when using --git-ids")
+ o.fatal("Don't provide filenames when using --git-ids")
if opt.verbose >= 2:
git.verbose = opt.verbose - 1
is_reverse = os.environ.get('BUP_SERVER_REVERSE')
if is_reverse and opt.remote:
- o.fatal("don't use -r in reverse mode; it's automatic")
+ o.fatal("Don't use -r in reverse mode; it's automatic")
start_time = time.time()
if opt.name and opt.name.startswith('.'):
- o.fatal("'%s' is not a valid branch 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.noop or opt.copy:
cli = pack_writer = oldref = None
print t
sys.exit(0)
elif len(extra) < 2:
- o.fatal('no commit ref or hash given.')
+ o.fatal('No commit ref or hash given.')
(tag_name, commit) = extra[:2]
if not tag_name:
- o.fatal("tag name must not be empty.")
+ o.fatal("Tag name must not be empty")
debug1("Parameters: Tag name = %s; commit = %s" % (tag_name, commit))
if tag_name in tags and not opt.force:
sys.exit(1)
if tag_name.startswith('.'):
- o.fatal("'%s' is not a valid tag name." % tag_name)
+ o.fatal("'%s' is not a valid tag name" % tag_name)
try:
hash = git.rev_parse(commit)
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
- o.fatal("no arguments expected")
+ o.fatal("No arguments expected")
t = time.time()
tleft = 1 - (t - int(t))
total = (opt.date or 0) + (opt.commit or 0) + (opt.tag or 0)
if total > 1:
- o.fatal('at most one option expected')
+ o.fatal('At most one option expected')
def version_date():
(opt, flags, extra) = o.parse(sys.argv[1:])
if len(extra) > 1:
- o.fatal("at most one argument expected")
+ o.fatal("At most one argument expected")
address = ('127.0.0.1', 8080)
if len(extra) > 0:
res = parse_timestamp(res)
except ValueError, ex:
if ex.args:
- o.fatal('unable to parse %s resolution "%s" (%s)'
+ o.fatal('Unable to parse %s resolution "%s" (%s)'
% (field, value, ex))
else:
- o.fatal('unable to parse %s resolution "%s"' % (field, value))
+ o.fatal('Unable to parse %s resolution "%s"' % (field, value))
if res != 1 and res % 10:
o.fatal('%s resolution "%s" must be a power of 10' % (field, value))
WVPASS bup init
WVPASS mkdir src
WVFAIL bup save --graft =/grafted -n graft-point-absolute src 2>&1 \
- | WVPASS grep 'error: a graft point cannot be empty'
+ | WVPASS grep 'Error: A graft point cannot be empty!'
WVFAIL bup save --graft $top/$tmp= -n graft-point-absolute src 2>&1 \
- | WVPASS grep 'error: a graft point cannot be empty'
+ | WVPASS grep 'Error: A graft point cannot be empty!'
WVSTART "save --graft /x/y=/a/b (relative paths)"