rust/rhg/src/commands/status.rs
changeset 48343 eb428010aad2
parent 48342 10c32e1b892a
child 48344 b6d8eea9872c
equal deleted inserted replaced
48342:10c32e1b892a 48343:eb428010aad2
   307 fn cat_file_is_modified(
   307 fn cat_file_is_modified(
   308     repo: &Repo,
   308     repo: &Repo,
   309     manifest: &Manifest,
   309     manifest: &Manifest,
   310     hg_path: &HgPath,
   310     hg_path: &HgPath,
   311 ) -> Result<bool, HgError> {
   311 ) -> Result<bool, HgError> {
   312     let file_node = manifest
   312     let entry = manifest
   313         .find_file(hg_path)?
   313         .find_file(hg_path)?
   314         .expect("ambgious file not in p1");
   314         .expect("ambgious file not in p1");
   315     let filelog = repo.filelog(hg_path)?;
   315     let filelog = repo.filelog(hg_path)?;
   316     let filelog_entry = filelog.data_for_node(file_node).map_err(|_| {
   316     let filelog_entry =
   317         HgError::corrupted("filelog missing node from manifest")
   317         filelog.data_for_node(entry.node_id()?).map_err(|_| {
   318     })?;
   318             HgError::corrupted("filelog missing node from manifest")
       
   319         })?;
   319     let contents_in_p1 = filelog_entry.data()?;
   320     let contents_in_p1 = filelog_entry.data()?;
   320 
   321 
   321     let fs_path = hg_path_to_os_string(hg_path).expect("HgPath conversion");
   322     let fs_path = hg_path_to_os_string(hg_path).expect("HgPath conversion");
   322     let fs_contents = repo.working_directory_vfs().read(fs_path)?;
   323     let fs_contents = repo.working_directory_vfs().read(fs_path)?;
   323     return Ok(contents_in_p1 != &*fs_contents);
   324     return Ok(contents_in_p1 != &*fs_contents);