rhg: fallback when encountering ellipsis revisions stable
authorRaphaël Gomès <rgomes@octobus.net>
Thu, 03 Nov 2022 14:58:58 +0100
branchstable
changeset 49551 7787174f0a5a
parent 49550 363923bd51cd
child 49552 5f778b3a94ca
rhg: fallback when encountering ellipsis revisions Ellipsis revisions are still experimental and buggy in non-trivial histories. We currently have no plans to improve this situation nor to add support for ellipsis revisions in `rhg`. Falling back should be done carefully (since we may have already done some work that is visible to the user), but in this case it's highly unlikely that we're doing anything useful with a repo with ellipsis revisions, so this should be strictly better, also since the error message is more explicit.
rust/hg-core/src/revlog/revlog.rs
--- a/rust/hg-core/src/revlog/revlog.rs	Wed Nov 02 12:05:34 2022 +0100
+++ b/rust/hg-core/src/revlog/revlog.rs	Thu Nov 03 14:58:58 2022 +0100
@@ -447,6 +447,11 @@
         ) {
             Ok(data)
         } else {
+            if (self.flags & REVISION_FLAG_ELLIPSIS) != 0 {
+                return Err(HgError::unsupported(
+                    "ellipsis revisions are not supported by rhg",
+                ));
+            }
             Err(corrupted(format!(
                 "hash check failed for revision {}",
                 self.rev