MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / import_graph_stream_prevalidated

Method import_graph_stream_prevalidated

atomic-cli/src/commands/git/stream.rs:495–525  ·  view source on GitHub ↗
(
        &self,
        repo: &mut Repository,
        plan: ProspectiveImportPlan,
        limits: GitStreamLimits,
    )

Source from the content-addressed store, hash-verified

493 }
494
495 pub(crate) fn import_graph_stream_prevalidated(
496 &self,
497 repo: &mut Repository,
498 plan: ProspectiveImportPlan,
499 limits: GitStreamLimits,
500 ) -> CliResult<ImportStats> {
501 let stream = plan
502 .stream
503 .ok_or_else(|| git_error("missing compact stream preflight"))?;
504 let total = stream.ordered.len();
505 let (merges, empty, files) = (stream.merges, stream.empty, stream.files);
506 let started = Instant::now();
507 let outcome =
508 self.import_graph_stream_rolling(repo, stream.tip, limits, &stream.ordered)?;
509 let kind = if self.options.span_stream {
510 "span"
511 } else {
512 "graph"
513 };
514 print_info(&format!("Direct {kind} stream: {} commits in {} private batches; final tip verified (historical states not independently verified)", outcome.commits, outcome.batches));
515 Ok(ImportStats {
516 commits_found: total,
517 commits_parsed: total,
518 changes_written: total - merges - empty,
519 merge_commits: merges,
520 empty_commits: empty,
521 files_processed: files,
522 phase2_duration: started.elapsed(),
523 ..Default::default()
524 })
525 }
526
527 /// Rebuild the compiler from the exact persisted prefix, then append only
528 /// the unimported suffix through the journaled private span stage.

Callers 1

import_branchMethod · 0.80

Calls 4

print_infoFunction · 0.85
git_errorFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected