Patchwork D11620: dirstate-v2: Change swap the order of size and mtime on disk

login
register
mail settings
Submitter phabricator
Date Oct. 8, 2021, 12:06 p.m.
Message ID <differential-rev-PHID-DREV-6mej4wgcfixuhxjpwvpc-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49944/
State Superseded
Headers show

Comments

phabricator - Oct. 8, 2021, 12:06 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This makes the dirstate-v2 file format match dirstate-v2 for the order of
  `mode`, `size`, and `mtime`. This order does not matter as long as these
  components are handled through named fields/attributes in code, but in a few
  places we still have tuples so having the same order everywhere might help
  avoid a bug that might not be obvious since those components have the same type.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11620

AFFECTED FILES
  rust/hg-core/src/dirstate_tree/on_disk.rs

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/dirstate_tree/on_disk.rs b/rust/hg-core/src/dirstate_tree/on_disk.rs
--- a/rust/hg-core/src/dirstate_tree/on_disk.rs
+++ b/rust/hg-core/src/dirstate_tree/on_disk.rs
@@ -173,8 +173,8 @@ 
 #[repr(C)]
 struct Entry {
     mode: I32Be,
+    size: I32Be,
     mtime: I32Be,
-    size: I32Be,
 }
 
 /// Duration since the Unix epoch