Read about our upcoming Code of Conduct on this issue

This instance was upgraded to Heptapod 0.28.0 today

Commit e2837c62 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

status: adapt largefile to gather stats at lookup time

See the core code for details of why we are doing this.

We don't factor the code in a common function yet, because we will have to adapt
a bit more things in the largefile case at the end of the series.

Differential Revision: https://phab.mercurial-scm.org/D11786
parent 41f40f35278a
......@@ -32,6 +32,7 @@ from mercurial import (
vfs as vfsmod,
)
from mercurial.utils import hashutil
from mercurial.dirstateutils import timestamp
shortname = b'.hglf'
shortnameslash = shortname + b'/'
......@@ -247,6 +248,7 @@ def lfdirstatestatus(lfdirstate, repo):
match, subrepos=[], ignored=False, clean=False, unknown=False
)
modified, clean = s.modified, s.clean
wctx = repo[None]
for lfile in unsure:
try:
fctx = pctx[standin(lfile)]
......@@ -256,7 +258,12 @@ def lfdirstatestatus(lfdirstate, repo):
modified.append(lfile)
else:
clean.append(lfile)
lfdirstate.set_clean(lfile)
st = wctx[lfile].lstat()
mode = st.st_mode
size = st.st_size
mtime = timestamp.mtime_of(st)
cache_data = (mode, size, mtime)
lfdirstate.set_clean(lfile, cache_data)
return s
......
......@@ -22,6 +22,8 @@ from mercurial import (
util,
)
from mercurial.dirstateutils import timestamp
from . import (
lfcommands,
lfutil,
......@@ -210,6 +212,7 @@ def reposetup(ui, repo):
s.clean,
)
if parentworking:
wctx = repo[None]
for lfile in unsure:
standin = lfutil.standin(lfile)
if standin not in ctx1:
......@@ -222,7 +225,12 @@ def reposetup(ui, repo):
else:
if listclean:
clean.append(lfile)
lfdirstate.set_clean(lfile)
s = wctx[lfile].lstat()
mode = s.st_mode
size = s.st_size
mtime = timestamp.mtime_of(s)
cache_data = (mode, size, mtime)
lfdirstate.set_clean(lfile, cache_data)
else:
tocheck = unsure + modified + added + clean
modified, added, clean = [], [], []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment