@@ -8,7 +8,7 @@ use crate::{
8
8
blob:: { packer:: Packer , tree:: TreeStreamerOnce , BlobType } ,
9
9
error:: RusticResult ,
10
10
index:: { indexer:: Indexer , ReadIndex } ,
11
- progress:: ProgressBars ,
11
+ progress:: { Progress , ProgressBars } ,
12
12
repofile:: SnapshotFile ,
13
13
repository:: { IndexedFull , IndexedIds , IndexedTree , Open , Repository } ,
14
14
} ;
@@ -71,20 +71,21 @@ pub(crate) fn copy<'a, Q, R: IndexedFull, P: ProgressBars, S: IndexedIds>(
71
71
index. total_size ( BlobType :: Tree ) ,
72
72
) ?;
73
73
74
- let p = pb. progress_counter ( "copying blobs in snapshots ..." ) ;
74
+ let p = pb. progress_bytes ( "copying blobs..." ) ;
75
75
76
76
snap_trees
77
77
. par_iter ( )
78
78
. try_for_each ( |id| -> RusticResult < _ > {
79
79
trace ! ( "copy tree blob {id}" ) ;
80
80
if !index_dest. has_tree ( id) {
81
81
let data = index. get_tree ( id) . unwrap ( ) . read_data ( be) ?;
82
+ p. inc ( data. len ( ) as u64 ) ;
82
83
tree_packer. add ( data, * id) ?;
83
84
}
84
85
Ok ( ( ) )
85
86
} ) ?;
86
87
87
- let tree_streamer = TreeStreamerOnce :: new ( be. clone ( ) , index, snap_trees, p ) ?;
88
+ let tree_streamer = TreeStreamerOnce :: new ( be. clone ( ) , index, snap_trees, pb . progress_hidden ( ) ) ?;
88
89
tree_streamer
89
90
. par_bridge ( )
90
91
. try_for_each ( |item| -> RusticResult < _ > {
@@ -97,6 +98,7 @@ pub(crate) fn copy<'a, Q, R: IndexedFull, P: ProgressBars, S: IndexedIds>(
97
98
trace ! ( "copy data blob {id}" ) ;
98
99
if !index_dest. has_data ( id) {
99
100
let data = index. get_data ( id) . unwrap ( ) . read_data ( be) ?;
101
+ p. inc ( data. len ( ) as u64 ) ;
100
102
data_packer. add ( data, * id) ?;
101
103
}
102
104
Ok ( ( ) )
@@ -109,6 +111,7 @@ pub(crate) fn copy<'a, Q, R: IndexedFull, P: ProgressBars, S: IndexedIds>(
109
111
trace ! ( "copy tree blob {id}" ) ;
110
112
if !index_dest. has_tree ( & id) {
111
113
let data = index. get_tree ( & id) . unwrap ( ) . read_data ( be) ?;
114
+ p. inc ( data. len ( ) as u64 ) ;
112
115
tree_packer. add ( data, id) ?;
113
116
}
114
117
}
0 commit comments