Show More
@@ -3,8 +3,9 b' use std::path::PathBuf;' | |||||
3 | use std::time::Duration; |
|
3 | use std::time::Duration; | |
4 |
|
4 | |||
5 | use super::path_with_basename::WithBasename; |
|
5 | use super::path_with_basename::WithBasename; | |
|
6 | use crate::dirstate::parsers::parse_dirstate_entries; | |||
|
7 | use crate::dirstate::parsers::parse_dirstate_parents; | |||
6 |
|
8 | |||
7 | use crate::dirstate::parsers::parse_dirstate_entries; |
|
|||
8 | use crate::matchers::Matcher; |
|
9 | use crate::matchers::Matcher; | |
9 | use crate::revlog::node::NULL_NODE; |
|
10 | use crate::revlog::node::NULL_NODE; | |
10 | use crate::utils::hg_path::{HgPath, HgPathBuf}; |
|
11 | use crate::utils::hg_path::{HgPath, HgPathBuf}; | |
@@ -175,9 +176,20 b' impl super::dispatch::DirstateMapMethods' | |||||
175 |
|
176 | |||
176 | fn parents( |
|
177 | fn parents( | |
177 | &mut self, |
|
178 | &mut self, | |
178 |
|
|
179 | file_contents: &[u8], | |
179 | ) -> Result<&DirstateParents, DirstateError> { |
|
180 | ) -> Result<&DirstateParents, DirstateError> { | |
180 | todo!() |
|
181 | if self.parents.is_none() { | |
|
182 | let parents = if !file_contents.is_empty() { | |||
|
183 | parse_dirstate_parents(file_contents)?.clone() | |||
|
184 | } else { | |||
|
185 | DirstateParents { | |||
|
186 | p1: NULL_NODE, | |||
|
187 | p2: NULL_NODE, | |||
|
188 | } | |||
|
189 | }; | |||
|
190 | self.parents = Some(parents); | |||
|
191 | } | |||
|
192 | Ok(self.parents.as_ref().unwrap()) | |||
181 | } |
|
193 | } | |
182 |
|
194 | |||
183 | fn set_parents(&mut self, parents: &DirstateParents) { |
|
195 | fn set_parents(&mut self, parents: &DirstateParents) { |
General Comments 0
You need to be logged in to leave comments.
Login now