comparison hgext/largefiles/reposetup.py @ 48382:991e6f728b50

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 18 Nov 2021 22:46:50 +0100
parents df3021c1f093
children 322525db4c98
comparison
equal deleted inserted replaced
48381:41f40f35278a 48382:991e6f728b50
19 localrepo, 19 localrepo,
20 match as matchmod, 20 match as matchmod,
21 scmutil, 21 scmutil,
22 util, 22 util,
23 ) 23 )
24
25 from mercurial.dirstateutils import timestamp
24 26
25 from . import ( 27 from . import (
26 lfcommands, 28 lfcommands,
27 lfutil, 29 lfutil,
28 ) 30 )
208 s.removed, 210 s.removed,
209 s.deleted, 211 s.deleted,
210 s.clean, 212 s.clean,
211 ) 213 )
212 if parentworking: 214 if parentworking:
215 wctx = repo[None]
213 for lfile in unsure: 216 for lfile in unsure:
214 standin = lfutil.standin(lfile) 217 standin = lfutil.standin(lfile)
215 if standin not in ctx1: 218 if standin not in ctx1:
216 # from second parent 219 # from second parent
217 modified.append(lfile) 220 modified.append(lfile)
220 ) != lfutil.hashfile(self.wjoin(lfile)): 223 ) != lfutil.hashfile(self.wjoin(lfile)):
221 modified.append(lfile) 224 modified.append(lfile)
222 else: 225 else:
223 if listclean: 226 if listclean:
224 clean.append(lfile) 227 clean.append(lfile)
225 lfdirstate.set_clean(lfile) 228 s = wctx[lfile].lstat()
229 mode = s.st_mode
230 size = s.st_size
231 mtime = timestamp.mtime_of(s)
232 cache_data = (mode, size, mtime)
233 lfdirstate.set_clean(lfile, cache_data)
226 else: 234 else:
227 tocheck = unsure + modified + added + clean 235 tocheck = unsure + modified + added + clean
228 modified, added, clean = [], [], [] 236 modified, added, clean = [], [], []
229 checkexec = self.dirstate._checkexec 237 checkexec = self.dirstate._checkexec
230 238