From fce5aed5bbab6c23299cb30da2d40aa515155245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Mon, 23 Nov 2015 17:30:49 -0500 Subject: [PATCH] move changed with other topical flags we need to have a sane default there otherwise the option may not be defined in some sub-commands and will crash --- borg/archiver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/borg/archiver.py b/borg/archiver.py index 6c2875d1b..1c396a920 100644 --- a/borg/archiver.py +++ b/borg/archiver.py @@ -74,7 +74,7 @@ class Archiver: logger.warning(msg) def print_file_status(self, status, path): - if self.args.changed: + if self.changed: print("%1s %s" % (status, remove_surrogates(path)), file=sys.stderr) def do_serve(self, args): @@ -1174,13 +1174,14 @@ class Archiver: args = self.preprocess_args(args) parser = self.build_parser(args) args = parser.parse_args(args or ['-h']) - self.args = args update_excludes(args) return args def run(self, args): os.umask(args.umask) # early, before opening files self.lock_wait = args.lock_wait + self.changed = getattr(args, 'changed', False) + self.unchanged = getattr(args, 'unchanged', False) RemoteRepository.remote_path = args.remote_path RemoteRepository.umask = args.umask setup_logging(level=args.log_level) # do not use loggers before this!