hgext/largefiles/overrides.py
branchstable
changeset 30190 56b930238036
parent 29420 e5c91dc909f7
child 30215 438173c41587
equal deleted inserted replaced
30189:4999c12c526b 30190:56b930238036
  1388         # (*1) deprecated, but used internally (e.g: "rebase --collapse")
  1388         # (*1) deprecated, but used internally (e.g: "rebase --collapse")
  1389 
  1389 
  1390         lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
  1390         lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
  1391         unsure, s = lfdirstate.status(matchmod.always(repo.root,
  1391         unsure, s = lfdirstate.status(matchmod.always(repo.root,
  1392                                                     repo.getcwd()),
  1392                                                     repo.getcwd()),
  1393                                       [], False, False, False)
  1393                                       [], False, True, False)
       
  1394         oldclean = set(s.clean)
  1394         pctx = repo['.']
  1395         pctx = repo['.']
  1395         for lfile in unsure + s.modified:
  1396         for lfile in unsure + s.modified:
  1396             lfileabs = repo.wvfs.join(lfile)
  1397             lfileabs = repo.wvfs.join(lfile)
  1397             if not repo.wvfs.exists(lfileabs):
  1398             if not repo.wvfs.exists(lfileabs):
  1398                 continue
  1399                 continue
  1400             standin = lfutil.standin(lfile)
  1401             standin = lfutil.standin(lfile)
  1401             lfutil.writestandin(repo, standin, lfhash,
  1402             lfutil.writestandin(repo, standin, lfhash,
  1402                                 lfutil.getexecutable(lfileabs))
  1403                                 lfutil.getexecutable(lfileabs))
  1403             if (standin in pctx and
  1404             if (standin in pctx and
  1404                 lfhash == lfutil.readstandin(repo, lfile, '.')):
  1405                 lfhash == lfutil.readstandin(repo, lfile, '.')):
  1405                 lfdirstate.normal(lfile)
  1406                 oldclean.add(lfile)
  1406         for lfile in s.added:
  1407         for lfile in s.added:
  1407             lfutil.updatestandin(repo, lfutil.standin(lfile))
  1408             lfutil.updatestandin(repo, lfutil.standin(lfile))
       
  1409         # mark all clean largefiles as dirty, just in case the update gets
       
  1410         # interrupted before largefiles and lfdirstate are synchronized
       
  1411         for lfile in oldclean:
       
  1412             lfdirstate.normallookup(lfile)
  1408         lfdirstate.write()
  1413         lfdirstate.write()
  1409 
  1414 
  1410         oldstandins = lfutil.getstandinsstate(repo)
  1415         oldstandins = lfutil.getstandinsstate(repo)
  1411 
  1416 
  1412         result = orig(repo, node, branchmerge, force, *args, **kwargs)
  1417         result = orig(repo, node, branchmerge, force, *args, **kwargs)
  1413 
  1418 
  1414         newstandins = lfutil.getstandinsstate(repo)
  1419         newstandins = lfutil.getstandinsstate(repo)
  1415         filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
  1420         filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
       
  1421 
       
  1422         # to avoid leaving all largefiles as dirty and thus rehash them, mark
       
  1423         # all the ones that didn't change as clean
       
  1424         for lfile in oldclean.difference(filelist):
       
  1425             lfdirstate.normal(lfile)
       
  1426         lfdirstate.write()
       
  1427 
  1416         if branchmerge or force or partial:
  1428         if branchmerge or force or partial:
  1417             filelist.extend(s.deleted + s.removed)
  1429             filelist.extend(s.deleted + s.removed)
  1418 
  1430 
  1419         lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
  1431         lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
  1420                                 normallookup=partial)
  1432                                 normallookup=partial)