Browse Source

Merge pull request #6629 from ThomasWaldmann/fix-iec-1.2

fix --iec mode output for borg delete and prune
TW 3 năm trước cách đây
mục cha
commit
26b46dd1f4
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      src/borg/archiver.py

+ 4 - 4
src/borg/archiver.py

@@ -1214,8 +1214,8 @@ class Archiver:
                 logger.warning('Aborted.')
             return self.exit_code
 
-        stats = Statistics()
-        with Cache(repository, key, manifest, progress=args.progress, lock_wait=self.lock_wait) as cache:
+        stats = Statistics(iec=args.iec)
+        with Cache(repository, key, manifest, progress=args.progress, lock_wait=self.lock_wait, iec=args.iec) as cache:
             msg_delete = 'Would delete archive: {} ({}/{})' if dry_run else 'Deleting archive: {} ({}/{})'
             msg_not_found = 'Archive {} not found ({}/{}).'
             logger_list = logging.getLogger('borg.output.list')
@@ -1538,8 +1538,8 @@ class Archiver:
                 keep += prune_split(archives, rule, num, kept_because)
 
         to_delete = (set(archives) | checkpoints) - (set(keep) | set(keep_checkpoints))
-        stats = Statistics()
-        with Cache(repository, key, manifest, lock_wait=self.lock_wait) as cache:
+        stats = Statistics(iec=args.iec)
+        with Cache(repository, key, manifest, lock_wait=self.lock_wait, iec=args.iec) as cache:
             list_logger = logging.getLogger('borg.output.list')
             # set up counters for the progress display
             to_delete_len = len(to_delete)