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

Method get_missing_changes_between

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

2316 /// println!("{} changes to insert", missing.len());
2317 /// ```
2318 pub fn get_missing_changes_between(
2319 &self,
2320 from_view: &str,
2321 to_view: Option<&str>,
2322 ) -> Result<Vec<Hash>, RepositoryError> {
2323 let txn = self
2324 .pristine
2325 .read_txn()
2326 .map_err(|e| RepositoryError::Database(e.to_string()))?;
2327
2328 let from = txn
2329 .get_view(from_view)
2330 .map_err(|e| RepositoryError::Database(e.to_string()))?
2331 .ok_or_else(|| RepositoryError::ViewNotFound {
2332 name: from_view.to_string(),
2333 })?;
2334
2335 let to_name = to_view.unwrap_or(&self.current_view);
2336 let to = txn
2337 .get_view(to_name)
2338 .map_err(|e| RepositoryError::Database(e.to_string()))?
2339 .ok_or_else(|| RepositoryError::ViewNotFound {
2340 name: to_name.to_string(),
2341 })?;
2342
2343 get_missing_changes(&txn, &from, &to).map_err(|e| RepositoryError::Apply(e.to_string()))
2344 }
2345
2346 /// Get changes up to a specific tag in a view.
2347 ///

Callers 3

run_promote_to_parentFunction · 0.80
run_previewFunction · 0.80

Calls 3

get_missing_changesFunction · 0.85
read_txnMethod · 0.80
get_viewMethod · 0.45

Tested by

no test coverage detected