Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | rust/rhg/src/commands/status.rs (9 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
646fc6eea92d | dc7b5b1677d4 | Raphaël Gomès | Mon, Mar 28, 12:26 PM |
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 |
use crate::utils::path_utils::RelativizePaths; | use crate::utils::path_utils::RelativizePaths; | ||||
use clap::{Arg, SubCommand}; | use clap::{Arg, SubCommand}; | ||||
use format_bytes::format_bytes; | use format_bytes::format_bytes; | ||||
use hg; | use hg; | ||||
use hg::config::Config; | use hg::config::Config; | ||||
use hg::dirstate::has_exec_bit; | use hg::dirstate::has_exec_bit; | ||||
use hg::dirstate::status::StatusPath; | use hg::dirstate::status::StatusPath; | ||||
use hg::dirstate::TruncatedTimestamp; | use hg::dirstate::TruncatedTimestamp; | ||||
use hg::dirstate::RANGE_MASK_31BIT; | |||||
use hg::errors::{HgError, IoResultExt}; | use hg::errors::{HgError, IoResultExt}; | ||||
use hg::lock::LockError; | use hg::lock::LockError; | ||||
use hg::manifest::Manifest; | use hg::manifest::Manifest; | ||||
use hg::matchers::AlwaysMatcher; | use hg::matchers::AlwaysMatcher; | ||||
use hg::repo::Repo; | use hg::repo::Repo; | ||||
use hg::utils::files::get_bytes_from_os_string; | use hg::utils::files::get_bytes_from_os_string; | ||||
use hg::utils::files::get_bytes_from_path; | use hg::utils::files::get_bytes_from_path; | ||||
use hg::utils::files::get_path_from_bytes; | use hg::utils::files::get_path_from_bytes; | ||||
if let Some(mtime) = | if let Some(mtime) = | ||||
TruncatedTimestamp::for_reliable_mtime_of( | TruncatedTimestamp::for_reliable_mtime_of( | ||||
&fs_metadata, | &fs_metadata, | ||||
&mtime_boundary, | &mtime_boundary, | ||||
) | ) | ||||
.when_reading_file(&fs_path)? | .when_reading_file(&fs_path)? | ||||
{ | { | ||||
let mode = fs_metadata.mode(); | let mode = fs_metadata.mode(); | ||||
let size = fs_metadata.len() as u32 & RANGE_MASK_31BIT; | let size = fs_metadata.len(); | ||||
let mut entry = dmap | dmap.set_clean(&hg_path, mode, size as u32, mtime)?; | ||||
.get(&hg_path)? | |||||
.expect("ambiguous file not in dirstate"); | |||||
entry.set_clean(mode, size, mtime); | |||||
dmap.add_file(&hg_path, entry)?; | |||||
dirstate_write_needed = true | dirstate_write_needed = true | ||||
} | } | ||||
} | } | ||||
} | } | ||||
drop(dmap); // Avoid "already mutably borrowed" RefCell panics | drop(dmap); // Avoid "already mutably borrowed" RefCell panics | ||||
if dirstate_write_needed { | if dirstate_write_needed { | ||||
repo.write_dirstate()? | repo.write_dirstate()? | ||||
} | } |