comparison rust/hg-core/src/dirstate_tree/dirstate_map.rs @ 47474:c657beacdf2e

dirstate-v2: Drop cached read_dir results after .hgignore changes Soon we’ll want the status algorithm to be able to skip `std::fs::read_dir` in more cases, notabling when listing unknown files but not ignored files. When ignore patterns change (which we detect by their hash, added to the dirstate-v2 format in a previous changeset), a formerly-ignored file could become unknown without changing its parent directory’s modification time. Therefore we remove any directory mtime from the dirstate, effictively invalidating the existing caches. Differential Revision: https://phab.mercurial-scm.org/D10907
author Simon Sapin <simon.sapin@octobus.net>
date Fri, 04 Jun 2021 15:26:38 +0200
parents 0ef8231e413f
children eb416759af7e
comparison
equal deleted inserted replaced
47473:5045ba2a3afd 47474:c657beacdf2e
491 } 491 }
492 } else { 492 } else {
493 return Ok(None); 493 return Ok(None);
494 } 494 }
495 } 495 }
496 }
497
498 pub(super) fn get_or_insert<'tree, 'path>(
499 &'tree mut self,
500 path: &HgPath,
501 ) -> Result<&'tree mut Node<'on_disk>, DirstateV2ParseError> {
502 Self::get_or_insert_node(
503 self.on_disk,
504 &mut self.root,
505 path,
506 WithBasename::to_cow_owned,
507 |_| {},
508 )
496 } 509 }
497 510
498 pub(super) fn get_or_insert_node<'tree, 'path>( 511 pub(super) fn get_or_insert_node<'tree, 'path>(
499 on_disk: &'on_disk [u8], 512 on_disk: &'on_disk [u8],
500 root: &'tree mut ChildNodes<'on_disk>, 513 root: &'tree mut ChildNodes<'on_disk>,