From 808d24d0888912b0fed96106a7354d442585be6f Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 4 Jul 2017 05:50:08 +0200 Subject: [PATCH] use commit() in borg with-lock, fixes #1867 --- src/borg/archiver.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index f84fbe4f0..1a4f80c50 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -1666,7 +1666,13 @@ def do_with_lock(self, args, repository): # we exit with the return code we get from the subprocess return subprocess.call([args.command] + args.args) finally: - repository.rollback() + # we need to commit the "no change" operation we did to the manifest + # because it created a new segment file in the repository. if we would + # roll back, the same file would be later used otherwise (for other content). + # that would be bad if somebody uses rsync with ignore-existing (or + # any other mechanism relying on existing segment data not changing). + # see issue #1867. + repository.commit() def do_debug_info(self, args): """display system information for debugging / bug reports"""