rust/rhg/src/commands/status.rs
changeset 48542 35c47015b9b7
parent 48540 20d0d896183e
child 48546 e91aa800ae5b
--- a/rust/rhg/src/commands/status.rs	Tue Dec 21 18:35:58 2021 +0100
+++ b/rust/rhg/src/commands/status.rs	Tue Dec 21 18:50:44 2021 +0100
@@ -512,17 +512,18 @@
     }
     let filelog = repo.filelog(hg_path)?;
     let fs_len = fs_metadata.len();
+    let filelog_entry =
+        filelog.entry_for_node(entry.node_id()?).map_err(|_| {
+            HgError::corrupted("filelog missing node from manifest")
+        })?;
     // TODO: check `fs_len` here like below, but based on
     // `RevlogEntry::uncompressed_len` without decompressing the full filelog
     // contents where possible. This is only valid if the revlog data does not
     // contain metadata. See how Python’s `revlog.rawsize` calls
     // `storageutil.filerevisioncopied`.
     // (Maybe also check for content-modifying flags? See `revlog.size`.)
-    let filelog_entry =
-        filelog.data_for_node(entry.node_id()?).map_err(|_| {
-            HgError::corrupted("filelog missing node from manifest")
-        })?;
-    let contents_in_p1 = filelog_entry.file_data()?;
+    let filelog_data = filelog_entry.data()?;
+    let contents_in_p1 = filelog_data.file_data()?;
     if contents_in_p1.len() as u64 != fs_len {
         // No need to read the file contents:
         // it cannot be equal if it has a different length.