rust-dirstate-entry: add `modified` method
This will also be used in other places later in the series.
Differential Revision: https://phab.mercurial-scm.org/D12536
--- a/rust/hg-core/src/dirstate/entry.rs Tue Apr 12 17:27:56 2022 +0200
+++ b/rust/hg-core/src/dirstate/entry.rs Tue Apr 12 17:29:21 2022 +0200
@@ -417,6 +417,11 @@
self.flags.contains(Flags::WDIR_TRACKED) && !self.in_either_parent()
}
+ pub fn modified(&self) -> bool {
+ self.flags
+ .contains(Flags::WDIR_TRACKED | Flags::P1_TRACKED | Flags::P2_INFO)
+ }
+
pub fn maybe_clean(&self) -> bool {
if !self.flags.contains(Flags::WDIR_TRACKED) {
false
@@ -463,10 +468,7 @@
}
if self.removed() {
EntryState::Removed
- } else if self
- .flags
- .contains(Flags::WDIR_TRACKED | Flags::P1_TRACKED | Flags::P2_INFO)
- {
+ } else if self.modified() {
EntryState::Merged
} else if self.added() {
EntryState::Added