| 1027 | } |
| 1028 | |
| 1029 | fn read_operation_kind( |
| 1030 | &mut self, |
| 1031 | encoding_version: u8, |
| 1032 | ) -> Result<OperationKind, OperationCodecError> { |
| 1033 | match self.read_u8()? { |
| 1034 | 0 => Ok(OperationKind::Anchor), |
| 1035 | 1 => Ok(OperationKind::Record), |
| 1036 | 2 => Ok(OperationKind::PromoteSnapshot), |
| 1037 | 3 => Ok(OperationKind::SplitSnapshot), |
| 1038 | 4 => Ok(OperationKind::SwitchView), |
| 1039 | 5 => Ok(OperationKind::Materialize), |
| 1040 | 6 => Ok(OperationKind::ImportGitHead), |
| 1041 | 7 => Ok(OperationKind::ImportGitRefs), |
| 1042 | 8 => Ok(OperationKind::ExportGitRefs), |
| 1043 | 9 => Ok(OperationKind::ProjectState), |
| 1044 | 10 => Ok(OperationKind::SynthesizeGit), |
| 1045 | 11 => Ok(OperationKind::ResurrectBinding), |
| 1046 | 12 => Ok(OperationKind::Insert), |
| 1047 | 13 => Ok(OperationKind::Unrecord), |
| 1048 | 14 => Ok(OperationKind::Tag), |
| 1049 | 15 => Ok(OperationKind::Recover), |
| 1050 | 16 => Ok(OperationKind::Undo), |
| 1051 | 17 => Ok(OperationKind::Gc), |
| 1052 | 18 if encoding_version == OPERATION_VERSION_V2 => Ok(OperationKind::Restore), |
| 1053 | 19 if encoding_version == OPERATION_VERSION_V2 => Ok(OperationKind::Pull), |
| 1054 | 20 if encoding_version == OPERATION_VERSION_V2 => Ok(OperationKind::Push), |
| 1055 | 21 if encoding_version == OPERATION_VERSION_V2 => Ok(OperationKind::Consolidate), |
| 1056 | 22 if encoding_version == OPERATION_VERSION_V2 => Ok(OperationKind::RefMapping), |
| 1057 | 23 if encoding_version == OPERATION_VERSION_V2 => Ok(OperationKind::Repair), |
| 1058 | 24 if encoding_version == OPERATION_VERSION_V2 => Ok(OperationKind::Cutover), |
| 1059 | 25 if encoding_version == OPERATION_VERSION_V2 => { |
| 1060 | Ok(OperationKind::ReconcileWorkingCopy) |
| 1061 | } |
| 1062 | tag => Err(OperationCodecError::new(format!( |
| 1063 | "unsupported operation kind tag {tag} for operation version {encoding_version}" |
| 1064 | ))), |
| 1065 | } |
| 1066 | } |
| 1067 | |
| 1068 | fn read_operation_relation(&mut self) -> Result<OperationRelation, OperationCodecError> { |
| 1069 | match self.read_u8()? { |