diff rust/hg-cpython/src/revlog.rs @ 52771:2fb13c3f4496

rust: add GraphError::ParentOutOfOrder This will be used in a follow-up commit that creates a data structure optimized for inserting revisions in descending order, since it will need to fail if a revision number is greater than its descendant (meaning the graph is corrupted).
author Mitchell Kember <mkember@janestreet.com>
date Fri, 07 Feb 2025 16:07:35 -0500
parents c2480ac4c5e2
children 8de68446a5bd
line wrap: on
line diff
--- a/rust/hg-cpython/src/revlog.rs	Fri Feb 07 16:03:35 2025 -0500
+++ b/rust/hg-cpython/src/revlog.rs	Fri Feb 07 16:07:35 2025 -0500
@@ -95,6 +95,9 @@
             Err(hg::GraphError::ParentOutOfRange(rev)) => {
                 Err(vcsgraph::graph::GraphReadError::KeyedInvalidKey(rev.0))
             }
+            Err(hg::GraphError::ParentOutOfOrder(_)) => {
+                Err(vcsgraph::graph::GraphReadError::InconsistentGraphData)
+            }
         }
     }
 }