mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-24 00:37:56 +00:00
parent
04d50c7141
commit
dd0c69ac32
3 changed files with 10 additions and 6 deletions
1
CHANGES
1
CHANGES
|
@ -7,6 +7,7 @@ Version 0.16
|
||||||
------------
|
------------
|
||||||
|
|
||||||
(bugfix release, released on X)
|
(bugfix release, released on X)
|
||||||
|
- Fix "All archives" output for attic info. (#183)
|
||||||
- More user friendly error message when repository key file is not found (#236)
|
- More user friendly error message when repository key file is not found (#236)
|
||||||
- Fix parsing of iso 8601 timestamps with zero microseconds (#282)
|
- Fix parsing of iso 8601 timestamps with zero microseconds (#282)
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ def save(self, name=None):
|
||||||
|
|
||||||
def calc_stats(self, cache):
|
def calc_stats(self, cache):
|
||||||
def add(id):
|
def add(id):
|
||||||
count, size, csize = self.cache.chunks[id]
|
count, size, csize = cache.chunks[id]
|
||||||
stats.update(size, csize, count == 1)
|
stats.update(size, csize, count == 1)
|
||||||
self.cache.chunks[id] = count - 1, size, csize
|
self.cache.chunks[id] = count - 1, size, csize
|
||||||
def add_file_chunks(chunks):
|
def add_file_chunks(chunks):
|
||||||
|
|
|
@ -93,11 +93,7 @@ def create(self):
|
||||||
with open(os.path.join(self.path, 'files'), 'w') as fd:
|
with open(os.path.join(self.path, 'files'), 'w') as fd:
|
||||||
pass # empty file
|
pass # empty file
|
||||||
|
|
||||||
def open(self):
|
def _do_open(self):
|
||||||
if not os.path.isdir(self.path):
|
|
||||||
raise Exception('%s Does not look like an Attic cache' % self.path)
|
|
||||||
self.lock = UpgradableLock(os.path.join(self.path, 'config'), exclusive=True)
|
|
||||||
self.rollback()
|
|
||||||
self.config = RawConfigParser()
|
self.config = RawConfigParser()
|
||||||
self.config.read(os.path.join(self.path, 'config'))
|
self.config.read(os.path.join(self.path, 'config'))
|
||||||
if self.config.getint('cache', 'version') != 1:
|
if self.config.getint('cache', 'version') != 1:
|
||||||
|
@ -110,6 +106,12 @@ def open(self):
|
||||||
self.chunks = ChunkIndex.read(os.path.join(self.path, 'chunks').encode('utf-8'))
|
self.chunks = ChunkIndex.read(os.path.join(self.path, 'chunks').encode('utf-8'))
|
||||||
self.files = None
|
self.files = None
|
||||||
|
|
||||||
|
def open(self):
|
||||||
|
if not os.path.isdir(self.path):
|
||||||
|
raise Exception('%s Does not look like an Attic cache' % self.path)
|
||||||
|
self.lock = UpgradableLock(os.path.join(self.path, 'config'), exclusive=True)
|
||||||
|
self.rollback()
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
if self.lock:
|
if self.lock:
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
|
@ -181,6 +183,7 @@ def rollback(self):
|
||||||
if os.path.exists(os.path.join(self.path, 'txn.tmp')):
|
if os.path.exists(os.path.join(self.path, 'txn.tmp')):
|
||||||
shutil.rmtree(os.path.join(self.path, 'txn.tmp'))
|
shutil.rmtree(os.path.join(self.path, 'txn.tmp'))
|
||||||
self.txn_active = False
|
self.txn_active = False
|
||||||
|
self._do_open()
|
||||||
|
|
||||||
def sync(self):
|
def sync(self):
|
||||||
"""Initializes cache by fetching and reading all archive indicies
|
"""Initializes cache by fetching and reading all archive indicies
|
||||||
|
|
Loading…
Reference in a new issue