mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-24 15:12:00 +00:00
Merge pull request #3714 from milkey-mouse/set-prev-location-early-bp1.1
Set cache previous_location on load instead of save (1.1 backport)
This commit is contained in:
commit
c5cf417df1
1 changed files with 1 additions and 1 deletions
|
@ -290,6 +290,7 @@ def load(self):
|
||||||
self.previous_location = recanonicalize_relative_location(previous_location, self.repository)
|
self.previous_location = recanonicalize_relative_location(previous_location, self.repository)
|
||||||
else:
|
else:
|
||||||
self.previous_location = None
|
self.previous_location = None
|
||||||
|
self._config.set('cache', 'previous_location', self.repository._location.canonical_path())
|
||||||
|
|
||||||
def save(self, manifest=None, key=None):
|
def save(self, manifest=None, key=None):
|
||||||
if manifest:
|
if manifest:
|
||||||
|
@ -304,7 +305,6 @@ def save(self, manifest=None, key=None):
|
||||||
self._config.set('integrity', 'manifest', manifest.id_str)
|
self._config.set('integrity', 'manifest', manifest.id_str)
|
||||||
if key:
|
if key:
|
||||||
self._config.set('cache', 'key_type', str(key.TYPE))
|
self._config.set('cache', 'key_type', str(key.TYPE))
|
||||||
self._config.set('cache', 'previous_location', self.repository._location.canonical_path())
|
|
||||||
with SaveFile(self.config_path) as fd:
|
with SaveFile(self.config_path) as fd:
|
||||||
self._config.write(fd)
|
self._config.write(fd)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue