pub struct Revision {
pub patch: Patch,
pub duplicates: Vec<(String, String)>,
pub resulting_data_hash: Sha256Hex,
}Expand description
A commit on a governance entry: an RFC 6902 patch from its previous version to the next.
Nothing is overwritten. The entry keeps the data it was signed with,
and its latest version is derived by applying every revision’s
patch in chain order, as git derives a checkout from its commits. See
AmendmentDraft::revision.
A value a patch adds (add, replace, test) lives in the amendment,
which redaction cannot reach yet; removals, moves and copies carry no
content.
Fields§
§patch: PatchFrom the previous version to this one
duplicates: Vec<(String, String)>For each remove of a duplicate, the removed path and the path it
duplicated: what a later redaction of the one must also erase from
the stored original. Not test ops, which would carry the values.
resulting_data_hash: Sha256HexWhat the entry’s data hashes to after patch
Implementations§
Source§impl Revision
impl Revision
Sourcepub fn validate(&self) -> Result<(), ReviseError>
pub fn validate(&self) -> Result<(), ReviseError>
Everything wrong with it that is checkable without data: an empty
patch, or a duplicate the patch does not remove
Sourcepub fn remove_duplicates(
data: &Value,
pairs: &[(&str, &str)],
) -> Result<Edit, ReviseError>
pub fn remove_duplicates( data: &Value, pairs: &[(&str, &str)], ) -> Result<Edit, ReviseError>
An Edit removing each (path, same_as) pair’s path, whose
value is byte-identical (as canonical_json) to same_as’s,
which it leaves in place