##// END OF EJS Templates
rhg: A missing .hg/dirstate file is not an error...
Simon Sapin -
r48113:1760de72 default
parent child Browse files
Show More
@@ -9,6 +9,7 b' use crate::error::CommandError;'
9 use crate::ui::Ui;
9 use crate::ui::Ui;
10 use clap::{Arg, SubCommand};
10 use clap::{Arg, SubCommand};
11 use hg;
11 use hg;
12 use hg::errors::HgResultExt;
12 use hg::errors::IoResultExt;
13 use hg::errors::IoResultExt;
13 use hg::matchers::AlwaysMatcher;
14 use hg::matchers::AlwaysMatcher;
14 use hg::operations::cat;
15 use hg::operations::cat;
@@ -164,8 +165,13 b' pub fn run(invocation: &crate::CliInvoca'
164
165
165 let repo = invocation.repo?;
166 let repo = invocation.repo?;
166 let mut dmap = DirstateMap::new();
167 let mut dmap = DirstateMap::new();
167 let dirstate_data = repo.hg_vfs().mmap_open("dirstate")?;
168 let dirstate_data =
168 let parents = dmap.read(&dirstate_data)?;
169 repo.hg_vfs().mmap_open("dirstate").io_not_found_as_none()?;
170 let dirstate_data = match &dirstate_data {
171 Some(mmap) => &**mmap,
172 None => b"",
173 };
174 let parents = dmap.read(dirstate_data)?;
169 let options = StatusOptions {
175 let options = StatusOptions {
170 // TODO should be provided by the dirstate parsing and
176 // TODO should be provided by the dirstate parsing and
171 // hence be stored on dmap. Using a value that assumes we aren't
177 // hence be stored on dmap. Using a value that assumes we aren't
General Comments 0
You need to be logged in to leave comments. Login now