Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FileCataloger mockable #20

Merged
merged 12 commits into from
Nov 26, 2017
Merged

Make FileCataloger mockable #20

merged 12 commits into from
Nov 26, 2017

Conversation

stensonowen
Copy link
Collaborator

allows unit tests (see last unit test in tests.rs for an example). I can write most of them if people are too busy to figure it out. (sorry for the delay, it ended up being a lot more nuanced than I expected).
fixes #13

also uses only a HashMap<Hash, Duplicates> for the thunk type of HashProxy (doesn't map ID to duplicates). So that means there's no distinction between a hard link and a duplicate file, right? So there's no difference in the output of FileCataloger between 2 links to the same file and 2 identical files? We talked about this way too much so presumably we agreed that was okay. fixes #12

harder than it needs to be. There's no (good) way to get a DirEntry from
a Path, so all PathBuf duplicate elements need to be replaced with a
File implementer
This reverts commit 0f7df61.

This is the elegant/fast solution but I don't think it'll work because
the DirWalker emits Paths and it would be awkward to change that.
Instead we're just going to add a method to vfs to look up a DirWalker
by path and hack it to work
in this case a Duplicates bucket can contain identical files, not just
links (unlike a FKBP). This negligibly simplifies / slows down things
Copy link
Owner

@zwimer zwimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More comments needed

@zwimer zwimer merged commit 4419cd3 into zwimer:master Nov 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make FileCataloger generic over a VFS Switch HashProxy::Thunk.thunk to map Hash to Duplicates
2 participants