update changed repo location immediately after acceptance

fixes #1524

before, if a longer backup got interrupted before commit(),
it asked same question again.
This commit is contained in:
Thomas Waldmann 2016-10-10 05:18:43 +02:00
parent a0df60e1b8
commit f50068944d
1 changed files with 3 additions and 0 deletions

View File

@ -77,6 +77,9 @@ class Cache:
if not yes(msg, false_msg="Aborting.", invalid_msg="Invalid answer, aborting.", if not yes(msg, false_msg="Aborting.", invalid_msg="Invalid answer, aborting.",
retry=False, env_var_override='BORG_RELOCATED_REPO_ACCESS_IS_OK'): retry=False, env_var_override='BORG_RELOCATED_REPO_ACCESS_IS_OK'):
raise self.RepositoryAccessAborted() raise self.RepositoryAccessAborted()
# adapt on-disk config immediately if the new location was accepted
self.begin_txn()
self.commit()
if sync and self.manifest.id != self.manifest_id: if sync and self.manifest.id != self.manifest_id:
# If repository is older than the cache something fishy is going on # If repository is older than the cache something fishy is going on