##// END OF EJS Templates
sparse: pass mergeresult obj in sparse.filterupdatesactions() (API)...
Pulkit Goyal -
r45847:d70c972c default
parent child Browse files
Show More
@@ -1130,10 +1130,7 b' def calculateupdates('
1130 fractions = _forgetremoved(wctx, mctx, branchmerge)
1130 fractions = _forgetremoved(wctx, mctx, branchmerge)
1131 mresult.updateactions(fractions)
1131 mresult.updateactions(fractions)
1132
1132
1133 prunedactions = sparse.filterupdatesactions(
1133 sparse.filterupdatesactions(repo, wctx, mctx, branchmerge, mresult)
1134 repo, wctx, mctx, branchmerge, mresult.actions
1135 )
1136 mresult.setactions(prunedactions)
1137 _resolvetrivial(repo, wctx, mctx, ancestors[0], mresult)
1134 _resolvetrivial(repo, wctx, mctx, ancestors[0], mresult)
1138
1135
1139 return mresult
1136 return mresult
@@ -366,16 +366,16 b' def matcher(repo, revs=None, includetemp'
366 return result
366 return result
367
367
368
368
369 def filterupdatesactions(repo, wctx, mctx, branchmerge, actions):
369 def filterupdatesactions(repo, wctx, mctx, branchmerge, mresult):
370 """Filter updates to only lay out files that match the sparse rules."""
370 """Filter updates to only lay out files that match the sparse rules."""
371 if not enabled:
371 if not enabled:
372 return actions
372 return
373
373
374 oldrevs = [pctx.rev() for pctx in wctx.parents()]
374 oldrevs = [pctx.rev() for pctx in wctx.parents()]
375 oldsparsematch = matcher(repo, oldrevs)
375 oldsparsematch = matcher(repo, oldrevs)
376
376
377 if oldsparsematch.always():
377 if oldsparsematch.always():
378 return actions
378 return
379
379
380 files = set()
380 files = set()
381 prunedactions = {}
381 prunedactions = {}
@@ -390,7 +390,7 b' def filterupdatesactions(repo, wctx, mct'
390 sparsematch = matcher(repo, [mctx.rev()])
390 sparsematch = matcher(repo, [mctx.rev()])
391
391
392 temporaryfiles = []
392 temporaryfiles = []
393 for file, action in pycompat.iteritems(actions):
393 for file, action in pycompat.iteritems(mresult.actions):
394 type, args, msg = action
394 type, args, msg = action
395 files.add(file)
395 files.add(file)
396 if sparsematch(file):
396 if sparsematch(file):
@@ -457,7 +457,7 b' def filterupdatesactions(repo, wctx, mct'
457 elif old and not new:
457 elif old and not new:
458 prunedactions[file] = (b'r', [], b'')
458 prunedactions[file] = (b'r', [], b'')
459
459
460 return prunedactions
460 mresult.setactions(prunedactions)
461
461
462
462
463 def refreshwdir(repo, origstatus, origsparsematch, force=False):
463 def refreshwdir(repo, origstatus, origsparsematch, force=False):
General Comments 0
You need to be logged in to leave comments. Login now