Import a single branch into an Atomic view using parallel processing.
(
&self,
git_repo: &GitRepository,
branch_name: &str,
repo: &mut Repository,
imported_shas: &HashSet<String>,
mainline_only: bool,
)
| 200 | impl Import { |
| 201 | /// Import a single branch into an Atomic view using parallel processing. |
| 202 | fn import_branch( |
| 203 | &self, |
| 204 | git_repo: &GitRepository, |
| 205 | branch_name: &str, |
| 206 | repo: &mut Repository, |
| 207 | imported_shas: &HashSet<String>, |
| 208 | mainline_only: bool, |
| 209 | ) -> CliResult<usize> { |
| 210 | // Get repository name from remote URL or working directory |
| 211 | let repo_name = self.get_repo_name(git_repo); |
| 212 | |
| 213 | // Create parallel importer with options |
| 214 | let options = ParallelImportOptions { |
| 215 | incremental: self.incremental, |
| 216 | imported_shas: imported_shas.clone(), |
| 217 | repo_name, |
| 218 | ignored_path_patterns: import_ignore_patterns( |
| 219 | git_repo.workdir().unwrap_or_else(|| repo.root()), |
| 220 | self.kind.as_deref(), |
| 221 | ), |
| 222 | mainline_only, |
| 223 | graph_only: !self.with_crdt, |
| 224 | }; |
| 225 | |
| 226 | let importer = ParallelImporter::new(git_repo, options); |
| 227 | |
| 228 | // Run the three-phase parallel import |
| 229 | let stats = importer.import_branch(branch_name, repo)?; |
| 230 | |
| 231 | // Return total changes created (written + empty + merge) |
| 232 | Ok(stats.changes_written + stats.empty_commits + stats.merge_commits) |
| 233 | } |
| 234 | |
| 235 | /// Get repository name from remote URL or working directory. |
| 236 | fn get_repo_name(&self, git_repo: &GitRepository) -> String { |
no test coverage detected