Get the on-disk path of a change file for direct file-based push. This returns the path to the `.change` file in the repository's change store, enabling `HttpRemote::upload_change_file()` to stream bytes directly from disk without the load → deserialize → re-serialize roundtrip. # Arguments `repo` - The repository containing the change. `hash` - The hash of the change. # Returns The path to t
(repo: &Repository, hash: &Hash)
| 210 | /// |
| 211 | /// Returns `CliError::ChangeNotFound` if the file doesn't exist. |
| 212 | pub fn change_file_path(repo: &Repository, hash: &Hash) -> CliResult<std::path::PathBuf> { |
| 213 | let base32 = hash.to_base32(); |
| 214 | let prefix = &base32[..2.min(base32.len())]; |
| 215 | let filename = format!("{}.change", base32); |
| 216 | let path = repo |
| 217 | .root() |
| 218 | .join(".atomic") |
| 219 | .join("changes") |
| 220 | .join(prefix) |
| 221 | .join(filename); |
| 222 | |
| 223 | if path.exists() { |
| 224 | Ok(path) |
| 225 | } else { |
| 226 | Err(CliError::ChangeNotFound { hash: base32 }) |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | // ============================================================================= |
| 231 | // Delta Transfer Protocol |