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>,
)
| 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 | /// |
no test coverage detected