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

Method get_missing_changes_between

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

2265 /// println!("{} changes to insert", missing.len());
2266 /// ```
2267 pub fn get_missing_changes_between(
2268 &self,
2269 from_view: &str,
2270 to_view: Option<&str>,
2271 ) -> Result<Vec<Hash>, RepositoryError> {
2272 let txn = self
2273 .pristine
2274 .read_txn()
2275 .map_err(|e| RepositoryError::Database(e.to_string()))?;
2276
2277 let from = txn
2278 .get_view(from_view)
2279 .map_err(|e| RepositoryError::Database(e.to_string()))?
2280 .ok_or_else(|| RepositoryError::ViewNotFound {
2281 name: from_view.to_string(),
2282 })?;
2283
2284 let to_name = to_view.unwrap_or(&self.current_view);
2285 let to = txn
2286 .get_view(to_name)
2287 .map_err(|e| RepositoryError::Database(e.to_string()))?
2288 .ok_or_else(|| RepositoryError::ViewNotFound {
2289 name: to_name.to_string(),
2290 })?;
2291
2292 get_missing_changes(&txn, &from, &to).map_err(|e| RepositoryError::Apply(e.to_string()))
2293 }
2294
2295 /// Get changes up to a specific tag in a view.
2296 ///

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