hgext/remotefilelog/__init__.py
changeset 45287 4ad6c4e9e35f
parent 45276 cb6a72dc0511
child 45294 30f3e278c5d7
equal deleted inserted replaced
45286:00e9c5edcd58 45287:4ad6c4e9e35f
   490         repo.fileservice.prefetch(files)
   490         repo.fileservice.prefetch(files)
   491     return orig(repo, actions, wctx, mctx, overwrite, wantfiledata, **opts)
   491     return orig(repo, actions, wctx, mctx, overwrite, wantfiledata, **opts)
   492 
   492 
   493 
   493 
   494 # Prefetch merge checkunknownfiles
   494 # Prefetch merge checkunknownfiles
   495 def checkunknownfiles(orig, repo, wctx, mctx, force, actions, *args, **kwargs):
   495 def checkunknownfiles(orig, repo, wctx, mctx, force, mresult, *args, **kwargs):
   496     if isenabled(repo):
   496     if isenabled(repo):
   497         files = []
   497         files = []
   498         sparsematch = repo.maybesparsematch(mctx.rev())
   498         sparsematch = repo.maybesparsematch(mctx.rev())
   499         for f, (m, actionargs, msg) in pycompat.iteritems(actions):
   499         for f, (m, actionargs, msg) in pycompat.iteritems(mresult.actions):
   500             if sparsematch and not sparsematch(f):
   500             if sparsematch and not sparsematch(f):
   501                 continue
   501                 continue
   502             if m in (b'c', b'dc', b'cm'):
   502             if m in (b'c', b'dc', b'cm'):
   503                 files.append((f, hex(mctx.filenode(f))))
   503                 files.append((f, hex(mctx.filenode(f))))
   504             elif m == b'dg':
   504             elif m == b'dg':
   505                 f2 = actionargs[0]
   505                 f2 = actionargs[0]
   506                 files.append((f2, hex(mctx.filenode(f2))))
   506                 files.append((f2, hex(mctx.filenode(f2))))
   507         # batch fetch the needed files from the server
   507         # batch fetch the needed files from the server
   508         repo.fileservice.prefetch(files)
   508         repo.fileservice.prefetch(files)
   509     return orig(repo, wctx, mctx, force, actions, *args, **kwargs)
   509     return orig(repo, wctx, mctx, force, mresult, *args, **kwargs)
   510 
   510 
   511 
   511 
   512 # Prefetch files before status attempts to look at their size and contents
   512 # Prefetch files before status attempts to look at their size and contents
   513 def checklookup(orig, self, files):
   513 def checklookup(orig, self, files):
   514     repo = self._repo
   514     repo = self._repo