mercurial/sparse.py
changeset 45290 d70c972cec74
parent 45106 a03c177a4679
child 45294 30f3e278c5d7
--- a/mercurial/sparse.py	Fri Jul 24 19:13:20 2020 +0530
+++ b/mercurial/sparse.py	Fri Jul 24 19:19:47 2020 +0530
@@ -366,16 +366,16 @@
     return result
 
 
-def filterupdatesactions(repo, wctx, mctx, branchmerge, actions):
+def filterupdatesactions(repo, wctx, mctx, branchmerge, mresult):
     """Filter updates to only lay out files that match the sparse rules."""
     if not enabled:
-        return actions
+        return
 
     oldrevs = [pctx.rev() for pctx in wctx.parents()]
     oldsparsematch = matcher(repo, oldrevs)
 
     if oldsparsematch.always():
-        return actions
+        return
 
     files = set()
     prunedactions = {}
@@ -390,7 +390,7 @@
         sparsematch = matcher(repo, [mctx.rev()])
 
     temporaryfiles = []
-    for file, action in pycompat.iteritems(actions):
+    for file, action in pycompat.iteritems(mresult.actions):
         type, args, msg = action
         files.add(file)
         if sparsematch(file):
@@ -457,7 +457,7 @@
             elif old and not new:
                 prunedactions[file] = (b'r', [], b'')
 
-    return prunedactions
+    mresult.setactions(prunedactions)
 
 
 def refreshwdir(repo, origstatus, origsparsematch, force=False):