This will also be used in other places later in the series.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
hg-reviewers |
This will also be used in other places later in the series.
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | rust/hg-core/src/dirstate/entry.rs (10 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
91aa4a8a9314 | 2e66c371b80e | Raphaël Gomès | Tue, Apr 12, 11:29 AM |
Status | Author | Revision | |
---|---|---|---|
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare |
pub fn p2_info(&self) -> bool { | pub fn p2_info(&self) -> bool { | ||||
self.flags.contains(Flags::WDIR_TRACKED | Flags::P2_INFO) | self.flags.contains(Flags::WDIR_TRACKED | Flags::P2_INFO) | ||||
} | } | ||||
pub fn added(&self) -> bool { | pub fn added(&self) -> bool { | ||||
self.flags.contains(Flags::WDIR_TRACKED) && !self.in_either_parent() | 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 { | pub fn maybe_clean(&self) -> bool { | ||||
if !self.flags.contains(Flags::WDIR_TRACKED) { | if !self.flags.contains(Flags::WDIR_TRACKED) { | ||||
false | false | ||||
} else if !self.flags.contains(Flags::P1_TRACKED) { | } else if !self.flags.contains(Flags::P1_TRACKED) { | ||||
false | false | ||||
} else if self.flags.contains(Flags::P2_INFO) { | } else if self.flags.contains(Flags::P2_INFO) { | ||||
false | false | ||||
} else { | } else { | ||||
fn v1_state(&self) -> EntryState { | fn v1_state(&self) -> EntryState { | ||||
if !self.any_tracked() { | if !self.any_tracked() { | ||||
// TODO: return an Option instead? | // TODO: return an Option instead? | ||||
panic!("Accessing v1_state of an untracked DirstateEntry") | panic!("Accessing v1_state of an untracked DirstateEntry") | ||||
} | } | ||||
if self.removed() { | if self.removed() { | ||||
EntryState::Removed | EntryState::Removed | ||||
} else if self | } else if self.modified() { | ||||
.flags | |||||
.contains(Flags::WDIR_TRACKED | Flags::P1_TRACKED | Flags::P2_INFO) | |||||
{ | |||||
EntryState::Merged | EntryState::Merged | ||||
} else if self.added() { | } else if self.added() { | ||||
EntryState::Added | EntryState::Added | ||||
} else { | } else { | ||||
EntryState::Normal | EntryState::Normal | ||||
} | } | ||||
} | } | ||||