Add a mechanism to the dirstate trees to allow lookups based on filtered views
of the keys. For a given filtering function, this returns one (if any) of the
keys for which filter(key) matches the input. The filtered values in each
directory node are cached to improve subsequent lookups.
Details
- Reviewers
durham - Group Reviewers
Restricted Project - Commits
- rFBHGX3607720eac2b: treedirstate: implement efficient case collision detection
Diff Detail
- Repository
- rFBHGX Facebook Mercurial Extensions
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
There's enough rust in here I'm not comfortable accepting just yet. Also a question inline.
rust/treedirstate/src/python.rs | ||
---|---|---|
371 | Unrelated to this diff, but I think we may want to move more of the dirstate business logic into pure rust (not the python interop layer) in the near future. So we can get to a pure native code hg status. | |
rust/treedirstate/src/tree.rs | ||
51 | We might want to be explicit that only one filter can be used with a tree at a time, since we don't invalidate the cache based on the filter. | |
treedirstate/__init__.py | ||
468 | If we didn't have _newfiles, why would calling it twice cause a problem? Doesn't the file that was added to the dirstate the first time have the same case as the file that's trying to be added a second time? And therefore is not a conflict? |
rust/treedirstate/src/python.rs | ||
---|---|---|
371 | In this case the casefolder is a python function, which is actually a bit complicated on some platforms (in particular cygwin - see posix.py). If we do move the casefolding business logic into Rust we'll need to handle that somehow (possibly by not supporting Cygwin). | |
treedirstate/__init__.py | ||
468 | Nothing gets added to the dirstate until after all candidates have been audited. The collision we're protecting against is in the self._newfilesfolded map, which contains the normalized forms only, not in the dirstate. |
rust/treedirstate/src/python.rs | ||
---|---|---|
7–8 | This could just be one line: use errors::{self, ErrorKind}; |
This could just be one line: