@@ -10,6 +10,17 @@ use crate::{
1010    RusticResult ,  WriteBackend ,  ALL_FILE_TYPES , 
1111} ; 
1212
13+ /// Repairs a hot/cold repository by copying missing files (except pack files) over from one to the other part. 
14+ /// 
15+ /// # Type Parameters 
16+ /// 
17+ /// * `P` - The progress bar type. 
18+ /// * `S` - The state the repository is in. 
19+ /// 
20+ /// # Arguments 
21+ /// 
22+ /// * `repo` - The repository 
23+ /// * `dry_run` - Do a dry run 
1324pub ( crate )  fn  repair_hotcold < P :  ProgressBars ,  S > ( 
1425    repo :  & Repository < P ,  S > , 
1526    dry_run :  bool , 
@@ -22,6 +33,17 @@ pub(crate) fn repair_hotcold<P: ProgressBars, S>(
2233    Ok ( ( ) ) 
2334} 
2435
36+ /// Repairs a hot/cold repository by copying missing tree pack files over from one to the other part. 
37+ /// 
38+ /// # Type Parameters 
39+ /// 
40+ /// * `P` - The progress bar type. 
41+ /// * `S` - The state the repository is in. 
42+ /// 
43+ /// # Arguments 
44+ /// 
45+ /// * `repo` - The repository 
46+ /// * `dry_run` - Do a dry run 
2547pub ( crate )  fn  repair_hotcold_packs < P :  ProgressBars ,  S :  Open > ( 
2648    repo :  & Repository < P ,  S > , 
2749    dry_run :  bool , 
@@ -35,6 +57,19 @@ pub(crate) fn repair_hotcold_packs<P: ProgressBars, S: Open>(
3557    ) 
3658} 
3759
60+ /// Copy relevant+misssing files in a hot/cold repository from one to the other part. 
61+ /// 
62+ /// # Type Parameters 
63+ /// 
64+ /// * `P` - The progress bar type. 
65+ /// * `S` - The state the repository is in. 
66+ /// 
67+ /// # Arguments 
68+ /// 
69+ /// * `repo` - The repository 
70+ /// * `file_type` - The filetype to copy 
71+ /// * `is_relevalt` - A closure to determine whether the id is relevat 
72+ /// * `dry_run` - Do a dry run 
3873pub ( crate )  fn  correct_missing_files < P :  ProgressBars ,  S > ( 
3974    repo :  & Repository < P ,  S > , 
4075    file_type :  FileType , 
@@ -91,6 +126,14 @@ pub(crate) fn correct_missing_files<P: ProgressBars, S>(
91126    Ok ( ( ) ) 
92127} 
93128
129+ /// Copy a list of files from one repo to another. 
130+ /// 
131+ /// # Arguments 
132+ /// 
133+ /// * `files` - The list of file ids to copy 
134+ /// * `file_type` - The filetype to copy 
135+ /// * `from` - The backend to read from 
136+ /// * `to` - The backend to write to 
94137fn  copy ( 
95138    files :  Vec < Id > , 
96139    file_type :  FileType , 
@@ -104,6 +147,20 @@ fn copy(
104147    Ok ( ( ) ) 
105148} 
106149
150+ /// Get all tree packs from from within the repository. 
151+ /// 
152+ /// # Type Parameters 
153+ /// 
154+ /// * `P` - The progress bar type. 
155+ /// * `S` - The state the repository is in. 
156+ /// 
157+ /// # Arguments 
158+ /// 
159+ /// * `repo` - The repository 
160+ /// 
161+ /// # Returns 
162+ /// 
163+ /// The set of pack ids. 
107164pub ( crate )  fn  get_tree_packs < P :  ProgressBars ,  S :  Open > ( 
108165    repo :  & Repository < P ,  S > , 
109166)  -> RusticResult < BTreeSet < PackId > >  { 
@@ -121,6 +178,22 @@ pub(crate) fn get_tree_packs<P: ProgressBars, S: Open>(
121178    Ok ( tree_packs) 
122179} 
123180
181+ /// Find missing files in the hot or cold part of the repository. 
182+ /// 
183+ /// # Type Parameters 
184+ /// 
185+ /// * `P` - The progress bar type. 
186+ /// * `S` - The state the repository is in. 
187+ /// 
188+ /// # Arguments 
189+ /// 
190+ /// * `repo` - The repository 
191+ /// * `file_type` - The filetype to use 
192+ /// * `is_relevalt` - A closure to determine whether the id is relevat 
193+ /// 
194+ /// # Returns 
195+ /// 
196+ /// A tuple containing ids missing in hot part, the total size, ids missing in cold part and the corresponding total size. 
124197pub ( crate )  fn  get_missing_files < P :  ProgressBars ,  S > ( 
125198    repo :  & Repository < P ,  S > , 
126199    file_type :  FileType , 
0 commit comments