Show More
@@ -263,6 +263,33 b' impl DirstateEntry {' | |||
|
263 | 263 | } |
|
264 | 264 | } |
|
265 | 265 | |
|
266 | pub fn drop_merge_data(&mut self) { | |
|
267 | if self.flags.contains(Flags::CLEAN_P1) | |
|
268 | || self.flags.contains(Flags::CLEAN_P2) | |
|
269 | || self.flags.contains(Flags::MERGED) | |
|
270 | || self.flags.contains(Flags::P2_TRACKED) | |
|
271 | { | |
|
272 | if self.flags.contains(Flags::MERGED) { | |
|
273 | self.flags.insert(Flags::P1_TRACKED); | |
|
274 | } else { | |
|
275 | self.flags.remove(Flags::P1_TRACKED); | |
|
276 | } | |
|
277 | self.flags.remove( | |
|
278 | Flags::MERGED | |
|
279 | | Flags::CLEAN_P1 | |
|
280 | | Flags::CLEAN_P2 | |
|
281 | | Flags::P2_TRACKED, | |
|
282 | ); | |
|
283 | self.flags.insert(Flags::POSSIBLY_DIRTY); | |
|
284 | self.mode = 0; | |
|
285 | self.mtime = 0; | |
|
286 | // size = None on the python size turn into size = NON_NORMAL when | |
|
287 | // accessed. So the next line is currently required, but a some | |
|
288 | // future clean up would be welcome. | |
|
289 | self.size = SIZE_NON_NORMAL; | |
|
290 | } | |
|
291 | } | |
|
292 | ||
|
266 | 293 | pub fn set_possibly_dirty(&mut self) { |
|
267 | 294 | self.flags.insert(Flags::POSSIBLY_DIRTY) |
|
268 | 295 | } |
@@ -166,6 +166,11 b' py_class!(pub class DirstateItem |py| {' | |||
|
166 | 166 | DirstateItem::create_instance(py, Cell::new(entry)) |
|
167 | 167 | } |
|
168 | 168 | |
|
169 | def drop_merge_data(&self) -> PyResult<PyNone> { | |
|
170 | self.update(py, |entry| entry.drop_merge_data()); | |
|
171 | Ok(PyNone) | |
|
172 | } | |
|
173 | ||
|
169 | 174 | def set_clean( |
|
170 | 175 | &self, |
|
171 | 176 | mode: i32, |
General Comments 0
You need to be logged in to leave comments.
Login now