Page MenuHomePhabricator

lfs: implement remotefilelog prefetch
ClosedPublic

Authored by dsp on Sep 18 2017, 10:21 PM.

Details

Reviewers
quark
Group Reviewers
Restricted Project
Commits
rFBHGX67bcc7709933: lfs: implement remotefilelog prefetch
Summary

When calling prefetch in remotefilelog, also prefetch lfs
files.

We are using the same hook mechanism that remotefilelog is already using
for LFS by having remotefilelog call into LFS.

Test Plan

run tests on test-lfs-remotefilelog-prefetch.t

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

dsp created this revision.Sep 18 2017, 10:21 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptSep 18 2017, 10:21 PM
quark requested changes to this revision.Sep 18 2017, 10:51 PM
quark added a subscriber: quark.

Nice feature! Could you move the fileserverclient wrapper related methods from lfs to remtoefilelog?

Currently, lfs does not couple with any remotefilelog internals (ex. fileserverclient) intentionally as an attempt to make future upstreaming work easier. The filelog wrapper code works both for remotefilelog and hg filelog.

This revision now requires changes to proceed.Sep 18 2017, 10:51 PM
durham added a subscriber: durham.Sep 19 2017, 12:04 PM

lgtm but @quark's request is probably reasonable.

hgext3rd/lfs/wrapper.py
258

Generally hash is used to refer to the 40 character version, and node refers to the 20 character one. So usually we dont' import the node module directly because it prevents us from using 'node' as a variable, so we just import bin/hex directly.

dsp updated this revision to Diff 1914.Sep 19 2017, 11:12 PM
quark accepted this revision.Sep 20 2017, 9:45 AM

Thanks!

This revision is now accepted and ready to land.Sep 20 2017, 9:45 AM
This revision was automatically updated to reflect the committed changes.