diff rust/hg-cpython/src/revlog.rs @ 52308:bd8081e9fd62

rust: don't star export from the `revlog` module This made a lot of the imports confusing because they didn't make sense at the top level (so, outside of `revlog`), and they hide the more common types when autocompleting.
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 26 Sep 2024 14:26:24 +0200
parents 1032bb0ef365
children c2480ac4c5e2
line wrap: on
line diff
--- a/rust/hg-cpython/src/revlog.rs	Thu Aug 01 11:27:20 2024 +0200
+++ b/rust/hg-cpython/src/revlog.rs	Thu Sep 26 14:26:24 2024 +0200
@@ -22,23 +22,24 @@
 use hg::{
     errors::HgError,
     fncache::FnCache,
-    index::{Phase, RevisionDataParams, SnapshotsCache, INDEX_ENTRY_SIZE},
-    nodemap::{Block, NodeMapError, NodeTree as CoreNodeTree},
     revlog::{
         compression::CompressionConfig,
+        index::{
+            Index, IndexHeader, Phase, RevisionDataParams, SnapshotsCache,
+            INDEX_ENTRY_SIZE,
+        },
         inner_revlog::{InnerRevlog as CoreInnerRevlog, RevisionBuffer},
-        nodemap::NodeMap,
+        nodemap::{Block, NodeMap, NodeMapError, NodeTree as CoreNodeTree},
         options::{
             RevlogDataConfig, RevlogDeltaConfig, RevlogFeatureConfig,
             RevlogOpenOptions,
         },
-        Graph, NodePrefix, RevlogError, RevlogIndex,
+        Graph, NodePrefix, RevlogError, RevlogIndex, RevlogType,
     },
     transaction::Transaction,
     utils::files::{get_bytes_from_path, get_path_from_bytes},
     vfs::FnCacheVfs,
-    BaseRevision, Node, Revision, RevlogType, UncheckedRevision,
-    NULL_REVISION,
+    BaseRevision, Node, Revision, UncheckedRevision, NULL_REVISION,
 };
 use std::{
     cell::{Cell, RefCell},
@@ -50,7 +51,7 @@
 
 pub struct PySharedIndex {
     /// The underlying hg-core index
-    pub(crate) inner: &'static hg::index::Index,
+    pub(crate) inner: &'static Index,
 }
 
 /// Return a Struct implementing the Graph trait
@@ -989,7 +990,7 @@
             },
             None => None,
         };
-        let header = hg::index::IndexHeader::parse(&header.to_be_bytes());
+        let header = IndexHeader::parse(&header.to_be_bytes());
         let header = header.expect("invalid header bytes");
         let path = inner
             .split_inline(header, new_index_file_path)
@@ -1732,7 +1733,7 @@
     }
 
     fn check_revision(
-        index: &hg::index::Index,
+        index: &Index,
         rev: UncheckedRevision,
         py: Python,
     ) -> PyResult<Revision> {
@@ -1999,7 +2000,7 @@
 
         // Safety: we keep the buffer around inside the class as `index_mmap`
         let (buf, bytes) = unsafe { mmap_keeparound(py, index_data)? };
-        let index = hg::index::Index::new(bytes, options.index_header())
+        let index = Index::new(bytes, options.index_header())
             .map_err(|e| revlog_error_from_msg(py, e))?;
 
         let base = &vfs_base.extract::<PyBytes>(py)?;