##// END OF EJS Templates
largefile: make sure we hold the lock when updating the second dirstate...
marmoute -
r50859:0cf4c1b8 default
parent child Browse files
Show More
@@ -223,6 +223,8 def openlfdirstate(ui, repo, create=True
223 # it. This ensures that we create it on the first meaningful
223 # it. This ensures that we create it on the first meaningful
224 # largefiles operation in a new clone.
224 # largefiles operation in a new clone.
225 if create and not vfs.exists(vfs.join(lfstoredir, b'dirstate')):
225 if create and not vfs.exists(vfs.join(lfstoredir, b'dirstate')):
226 try:
227 with repo.wlock(wait=False):
226 matcher = getstandinmatcher(repo)
228 matcher = getstandinmatcher(repo)
227 standins = repo.dirstate.walk(
229 standins = repo.dirstate.walk(
228 matcher, subrepos=[], unknown=False, ignored=False
230 matcher, subrepos=[], unknown=False, ignored=False
@@ -235,8 +237,16 def openlfdirstate(ui, repo, create=True
235 for standin in standins:
237 for standin in standins:
236 lfile = splitstandin(standin)
238 lfile = splitstandin(standin)
237 lfdirstate.update_file(
239 lfdirstate.update_file(
238 lfile, p1_tracked=True, wc_tracked=True, possibly_dirty=True
240 lfile,
241 p1_tracked=True,
242 wc_tracked=True,
243 possibly_dirty=True,
239 )
244 )
245 except error.LockError:
246 # Assume that whatever was holding the lock was important.
247 # If we were doing something important, we would already have
248 # either the lock or a largefile dirstate.
249 pass
240 return lfdirstate
250 return lfdirstate
241
251
242
252
General Comments 0
You need to be logged in to leave comments. Login now