Skip to main content

candidate_deletions

Function candidate_deletions 

Source
pub fn candidate_deletions(
    root: &Path,
    manifest: &Path,
    read: &dyn Fn(&str) -> Option<String>,
    dir: &Path,
) -> Result<Vec<Deleted>>
Expand description

The files under dir that each candidate’s Version PR deleted since the version in manifest was last stable, newest first.

The walk follows HEAD’s first parents. A commit whose first parent contains another version in manifest set a version. The first such commit that set a version with no prerelease ends the walk, and its own deletions are left out: they belong to that stable release. Every other commit that set a version is a candidate’s Version PR, and each file under dir its first parent contains and it does not is listed. The merge queue lands a Version PR as a merge commit, so the fragments it consumed show in that diff. A commit that set no version deleted no fragment a release consumed, so its deletions are skipped. With no stable version on the history, the walk reads to the root commit.

read returns None when a revision of the file contains no version, which counts as a different version.

§Errors

Returns an error when root is in no repository, when manifest or dir is outside it, or when a commit or tree cannot be read. It returns a lookup::Unavailable error naming the commit when the walk reaches a shallow clone’s boundary first, because a stable section built without the rest would leave changes out.