Parse Cargo.lock at `rev`. Returns (format_version, {id: fingerprint}, {id: deps_tuple}) where id = (name, version, source-or-None), or None when the lock cannot be read/parsed at that revision.
(rev)
| 175 | f in CROSS_EXACT |
| 176 | or any(f.startswith(p) for p in CROSS_PREFIX) |
| 177 | or Path(f).name.startswith("rust-toolchain") |
| 178 | ) |
| 179 | |
| 180 | |
| 181 | def _toml_at(rev, path): |
| 182 | res = run(["git", "show", f"{rev}:{path}"]) |
| 183 | if res.returncode != 0: |
| 184 | return None |
| 185 | try: |
| 186 | return tomllib.loads(res.stdout) |
| 187 | except tomllib.TOMLDecodeError: |
| 188 | return None |
| 189 | |
| 190 | |
| 191 | def _without_workspace_members(manifest): |
| 192 | stripped = deepcopy(manifest) |
| 193 | workspace = stripped.get("workspace") |
| 194 | if isinstance(workspace, dict): |
| 195 | workspace.pop("members", None) |
| 196 | return stripped |
| 197 | |
| 198 | |
| 199 | def root_manifest_change_is_workspace_members_only(base, head): |
| 200 | mb = run(["git", "merge-base", base, head]) |
no test coverage detected