This is an archive of the discontinued Mercurial Phabricator instance.

store: introduce a function to get tracked path from a fncache entry
AbandonedPublic

Authored by pulkit on Oct 3 2018, 11:02 AM.

Details

Reviewers
indygreg
Group Reviewers
hg-reviewers
Summary

This patch introduces a function to get the trakced path from a fncache entry.
This will be used to filter out files to streamclone using a narrowmatcher.

The function decodes the entries, and then returns the part after omitting the
ending .d, .i and starting meta/ and data/.

I am not sure if this is correct.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Oct 3 2018, 11:02 AM
pulkit added a subscriber: yuja.Oct 12 2018, 5:30 PM

@yuja You might want to look at this. This is what I was referencing to when I mentioned about getting the filename back from a fncache entry. We need this for narrow-stream clones.

indygreg requested changes to this revision.Oct 13 2018, 3:54 AM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
mercurial/store.py
36–37

The fncache file doesn't track filenames beginning with dh/.

The fncache tracks the real full paths and then store filename encoding happens later.

This revision now requires changes to proceed.Oct 13 2018, 3:54 AM

... And the fncache tracks the paths that are fed into the vfs. I'm not sure why you'd want to strip the "data/" and "meta/" prefixes in this function.

If you are operating on a filelog, you "know" that its path should be prefixed with "data/".

pulkit abandoned this revision.Nov 13 2018, 9:04 AM

This was an incorrect implementation. A better implementation has been pushed as part of D5139.