Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions docs/internals/frontends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,8 @@ stats
Number of unique chunks
total_size
Total uncompressed size of all chunks multiplied with their reference counts
total_csize
Total compressed and encrypted size of all chunks multiplied with their reference counts
unique_size
Uncompressed size of all chunks
unique_csize
Compressed and encrypted size of all chunks

.. highlight: json

Expand All @@ -285,10 +281,8 @@ Example *borg info* output::
"path": "/home/user/.cache/borg/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
"stats": {
"total_chunks": 511533,
"total_csize": 17948017540,
"total_size": 22635749792,
"total_unique_chunks": 54892,
"unique_csize": 1920405405,
"unique_size": 2449675468
}
},
Expand Down Expand Up @@ -424,10 +418,8 @@ The same archive with more information (``borg info --last 1 --json``)::
"path": "/home/user/.cache/borg/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
"stats": {
"total_chunks": 511533,
"total_csize": 17948017540,
"total_size": 22635749792,
"total_unique_chunks": 54892,
"unique_csize": 1920405405,
"unique_size": 2449675468
}
},
Expand Down Expand Up @@ -495,26 +487,26 @@ added:

removed:
See **added** property.

old_mode:
If **type** == '*mode*', then **old_mode** and **new_mode** provide the mode and permissions changes.

new_mode:
See **old_mode** property.

old_user:
If **type** == '*owner*', then **old_user**, **new_user**, **old_group** and **new_group** provide the user
and group ownership changes.

old_group:
See **old_user** property.

new_user:
See **old_user** property.

new_group:
See **old_user** property.


Example (excerpt) of ``borg diff --json-lines``::

Expand Down
132 changes: 47 additions & 85 deletions src/borg/archive.py

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/borg/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
assert EXIT_ERROR == 2, "EXIT_ERROR is not 2, as expected - fix assert AND exception handler right above this line."


STATS_HEADER = " Original size Compressed size Deduplicated size"
STATS_HEADER = " Original size Deduplicated size"

PURE_PYTHON_MSGPACK_WARNING = "Using a pure-python msgpack! This will result in lower performance."

Expand Down Expand Up @@ -361,7 +361,7 @@ def upgrade_item(item):
chunks, chunks_healthy = hlm.retrieve(id=hlid, default=(None, None))
if chunks is not None:
item._dict['chunks'] = chunks
for chunk_id, _, _ in chunks:
for chunk_id, _ in chunks:
cache.chunk_incref(chunk_id, archive.stats)
if chunks_healthy is not None:
item._dict['chunks_healthy'] = chunks
Expand Down Expand Up @@ -424,7 +424,7 @@ def upgrade_zlib_and_level(chunk):
for item in other_archive.iter_items():
if 'chunks' in item:
chunks = []
for chunk_id, size, _ in item.chunks:
for chunk_id, size in item.chunks:
refcount = cache.seen_chunk(chunk_id, size)
if refcount == 0: # target repo does not yet have this chunk
if not dry_run:
Expand All @@ -443,7 +443,7 @@ def upgrade_zlib_and_level(chunk):
chunks.append(chunk_entry)
present_size += size
if not dry_run:
item.chunks = chunks # overwrite! IDs and sizes are same, csizes are likely different
item.chunks = chunks # TODO: overwrite? IDs and sizes are same.
archive.stats.nfiles += 1
if not dry_run:
archive.add_item(upgrade_item(item))
Expand Down Expand Up @@ -1331,7 +1331,7 @@ def item_content_stream(item):
"""
Return a file-like object that reads from the chunks of *item*.
"""
chunk_iterator = archive.pipeline.fetch_many([chunk_id for chunk_id, _, _ in item.chunks],
chunk_iterator = archive.pipeline.fetch_many([chunk_id for chunk_id, _ in item.chunks],
is_preloaded=True)
if pi:
info = [remove_surrogates(item.path)]
Expand Down Expand Up @@ -1797,8 +1797,8 @@ def format_cmdline(cmdline):
Command line: {command_line}
Utilization of maximum supported archive size: {limits[max_archive_size]:.0%}
------------------------------------------------------------------------------
Original size Compressed size Deduplicated size
This archive: {stats[original_size]:>20s} {stats[compressed_size]:>20s} {stats[deduplicated_size]:>20s}
Original size Deduplicated size
This archive: {stats[original_size]:>20s} {stats[deduplicated_size]:>20s}
{cache}
""").strip().format(cache=cache, **info))
if self.exit_code:
Expand Down
Loading