diff --git a/changelog/unreleased/pull-5319 b/changelog/unreleased/pull-5319 index e4c1f0865..a512c3613 100644 --- a/changelog/unreleased/pull-5319 +++ b/changelog/unreleased/pull-5319 @@ -1,8 +1,8 @@ Enhancement: add more status counters to `restic copy` `restic copy` now produces more status counters in text format. The new counters -are the number of tree/data blobs, their sizes and the number of packfiles -they are attachedc to. +are the number of blobs to copy, their size on disk and the number of packfiles +used from the source repository. https://github.com/restic/restic/issues/5175 https://github.com/restic/restic/pull/5319 diff --git a/cmd/restic/cmd_copy.go b/cmd/restic/cmd_copy.go index 2281e9d05..498d6f75d 100644 --- a/cmd/restic/cmd_copy.go +++ b/cmd/restic/cmd_copy.go @@ -251,7 +251,9 @@ func copyTree(ctx context.Context, srcRepo restic.Repository, dstRepo restic.Rep return nil } +// copyStats: print statistics for the blobs to be copied func copyStats(srcRepo restic.Repository, copyBlobs restic.BlobSet, packList restic.IDSet, printer progress.Printer) { + // count and size countBlobs := 0 sizeBlobs := uint64(0) @@ -259,10 +261,10 @@ func copyStats(srcRepo restic.Repository, copyBlobs restic.BlobSet, packList res for _, blob := range srcRepo.LookupBlob(blob.Type, blob.ID) { countBlobs++ sizeBlobs += uint64(blob.Length) + break } - break } - printer.V(" %7d all blobs with a size %11s in %7d packfiles\n", + printer.V(" copy %d blobs with disk size %s in %d packfiles\n", countBlobs, ui.FormatBytes(uint64(sizeBlobs)), len(packList)) }