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

Method get_missing_changes_between

atomic-repository/src/repository/insert.rs:3343–3369  ·  view source on GitHub ↗

Get changes that are in one view but not another. This is useful for determining what needs to be inserted when merging or cherry-picking between views. # Arguments `from_view` - Source view name `to_view` - Target view name (None = current view) # Returns Vector of hashes that are in `from_view` but not in `to_view`, in dependency order. # Example ```rust,ignore // Find what's in feature t

(
        &self,
        from_view: &str,
        to_view: Option<&str>,
    )

Source from the content-addressed store, hash-verified

3341 /// println!("{} changes to insert", missing.len());
3342 /// ```
3343 pub fn get_missing_changes_between(
3344 &self,
3345 from_view: &str,
3346 to_view: Option<&str>,
3347 ) -> Result<Vec<Hash>, RepositoryError> {
3348 let txn = self
3349 .pristine
3350 .read_txn()
3351 .map_err(|e| RepositoryError::Database(e.to_string()))?;
3352
3353 let from = txn
3354 .get_view(from_view)
3355 .map_err(|e| RepositoryError::Database(e.to_string()))?
3356 .ok_or_else(|| RepositoryError::ViewNotFound {
3357 name: from_view.to_string(),
3358 })?;
3359
3360 let to_name = to_view.unwrap_or(&self.current_view);
3361 let to = txn
3362 .get_view(to_name)
3363 .map_err(|e| RepositoryError::Database(e.to_string()))?
3364 .ok_or_else(|| RepositoryError::ViewNotFound {
3365 name: to_name.to_string(),
3366 })?;
3367
3368 get_missing_changes(&txn, &from, &to).map_err(|e| RepositoryError::Apply(e.to_string()))
3369 }
3370
3371 /// Get changes up to a specific tag in a view.
3372 ///

Callers 6

run_promote_to_parentFunction · 0.80
run_previewFunction · 0.80
review_decision_scopeMethod · 0.80
preview_mutationMethod · 0.80
insert_changesMethod · 0.80

Calls 3

get_missing_changesFunction · 0.85
read_txnMethod · 0.80
get_viewMethod · 0.45

Tested by

no test coverage detected