From patchwork Fri Oct 8 12:06:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11620: dirstate-v2: Change swap the order of size and mtime on disk From: phabricator X-Patchwork-Id: 49944 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 8 Oct 2021 12:06:37 +0000 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 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