##// END OF EJS Templates
largefiles: avoid redundant changectx looking up at each repetitions...
FUJIWARA Katsunori -
r31654:1af4a164 default
parent child Browse files
Show More
@@ -403,9 +403,10 b' def cachelfiles(ui, repo, node, filelist'
403 403 lfiles = set(lfiles) & set(filelist)
404 404 toget = []
405 405
406 ctx = repo[node]
406 407 for lfile in lfiles:
407 408 try:
408 expectedhash = repo[node][lfutil.standin(lfile)].data().strip()
409 expectedhash = ctx[lfutil.standin(lfile)].data().strip()
409 410 except IOError as err:
410 411 if err.errno == errno.ENOENT:
411 412 continue # node must be None and standin wasn't found in wctx
@@ -457,6 +458,7 b' def updatelfiles(ui, repo, filelist=None'
457 458 update = {}
458 459 updated, removed = 0, 0
459 460 wvfs = repo.wvfs
461 wctx = repo[None]
460 462 for lfile in lfiles:
461 463 rellfile = lfile
462 464 rellfileorig = os.path.relpath(
@@ -474,7 +476,7 b' def updatelfiles(ui, repo, filelist=None'
474 476 wvfs.unlinkpath(relstandinorig)
475 477 expecthash = lfutil.readstandin(repo, lfile)
476 478 if expecthash != '':
477 if lfile not in repo[None]: # not switched to normal file
479 if lfile not in wctx: # not switched to normal file
478 480 wvfs.unlinkpath(rellfile, ignoremissing=True)
479 481 # use normallookup() to allocate an entry in largefiles
480 482 # dirstate to prevent lfilesrepo.status() from reporting
@@ -487,7 +489,7 b' def updatelfiles(ui, repo, filelist=None'
487 489 # largefile is converted back to a normal file: the standin
488 490 # disappears, but a new (normal) file appears as the lfile.
489 491 if (wvfs.exists(rellfile) and
490 repo.dirstate.normalize(lfile) not in repo[None]):
492 repo.dirstate.normalize(lfile) not in wctx):
491 493 wvfs.unlinkpath(rellfile)
492 494 removed += 1
493 495
@@ -759,11 +759,12 b' def overriderevert(orig, ui, repo, ctx, '
759 759 lfdirstate = lfutil.openlfdirstate(mctx.repo().ui, mctx.repo(),
760 760 False)
761 761
762 wctx = repo[None]
762 763 def tostandin(f):
763 764 standin = lfutil.standin(f)
764 765 if standin in ctx or standin in mctx:
765 766 return standin
766 elif standin in repo[None] or lfdirstate[f] == 'r':
767 elif standin in wctx or lfdirstate[f] == 'r':
767 768 return None
768 769 return f
769 770 m._files = [tostandin(f) for f in m._files]
@@ -1077,8 +1078,9 b' def cmdutilforget(orig, ui, repo, match,'
1077 1078 s = repo.status(match=m, clean=True)
1078 1079 finally:
1079 1080 repo.lfstatus = False
1081 manifest = repo[None].manifest()
1080 1082 forget = sorted(s.modified + s.added + s.deleted + s.clean)
1081 forget = [f for f in forget if lfutil.standin(f) in repo[None].manifest()]
1083 forget = [f for f in forget if lfutil.standin(f) in manifest]
1082 1084
1083 1085 for f in forget:
1084 1086 fstandin = lfutil.standin(f)
General Comments 0
You need to be logged in to leave comments. Login now