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

Method get_missing_changes_between

atomic-repository/src/repository/insert.rs:3293–3319  ·  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

3291 /// println!("{} changes to insert", missing.len());
3292 /// ```
3293 pub fn get_missing_changes_between(
3294 &self,
3295 from_view: &str,
3296 to_view: Option<&str>,
3297 ) -> Result<Vec<Hash>, RepositoryError> {
3298 let txn = self
3299 .pristine
3300 .read_txn()
3301 .map_err(|e| RepositoryError::Database(e.to_string()))?;
3302
3303 let from = txn
3304 .get_view(from_view)
3305 .map_err(|e| RepositoryError::Database(e.to_string()))?
3306 .ok_or_else(|| RepositoryError::ViewNotFound {
3307 name: from_view.to_string(),
3308 })?;
3309
3310 let to_name = to_view.unwrap_or(&self.current_view);
3311 let to = txn
3312 .get_view(to_name)
3313 .map_err(|e| RepositoryError::Database(e.to_string()))?
3314 .ok_or_else(|| RepositoryError::ViewNotFound {
3315 name: to_name.to_string(),
3316 })?;
3317
3318 get_missing_changes(&txn, &from, &to).map_err(|e| RepositoryError::Apply(e.to_string()))
3319 }
3320
3321 /// Get changes up to a specific tag in a view.
3322 ///

Callers 5

run_promote_to_parentFunction · 0.80
run_previewFunction · 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