##// END OF EJS Templates
merge: restate calculateupdates in terms of a matcher...
Augie Fackler -
r27345:98266b1d default
parent child Browse files
Show More
@@ -253,7 +253,7 b' def perfmergecalculate(ui, repo, rev, **'
253 # acceptremote is True because we don't want prompts in the middle of
253 # acceptremote is True because we don't want prompts in the middle of
254 # our benchmark
254 # our benchmark
255 merge.calculateupdates(repo, wctx, rctx, [ancestor], False, False,
255 merge.calculateupdates(repo, wctx, rctx, [ancestor], False, False,
256 False, acceptremote=True, followcopies=True)
256 acceptremote=True, followcopies=True)
257 timer(d)
257 timer(d)
258 fm.end()
258 fm.end()
259
259
@@ -679,4 +679,3 b' def perflrucache(ui, size=4, gets=10000,'
679 timer, fm = gettimer(ui, opts)
679 timer, fm = gettimer(ui, opts)
680 timer(fn, title=title)
680 timer(fn, title=title)
681 fm.end()
681 fm.end()
682
@@ -192,7 +192,6 b' class mercurial_sink(converter_sink):'
192 self.repo, p1ctx, p2ctx, anc,
192 self.repo, p1ctx, p2ctx, anc,
193 True, # branchmerge
193 True, # branchmerge
194 True, # force
194 True, # force
195 False, # partial
196 False, # acceptremote
195 False, # acceptremote
197 False, # followcopies
196 False, # followcopies
198 )
197 )
@@ -458,11 +458,11 b' def overridecheckunknownfile(origfn, rep'
458 # writing the files into the working copy and lfcommands.updatelfiles
458 # writing the files into the working copy and lfcommands.updatelfiles
459 # will update the largefiles.
459 # will update the largefiles.
460 def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
460 def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
461 partial, acceptremote, followcopies):
461 acceptremote, followcopies, matcher=None):
462 overwrite = force and not branchmerge
462 overwrite = force and not branchmerge
463 actions, diverge, renamedelete = origfn(
463 actions, diverge, renamedelete = origfn(
464 repo, p1, p2, pas, branchmerge, force, partial, acceptremote,
464 repo, p1, p2, pas, branchmerge, force, acceptremote,
465 followcopies)
465 followcopies, matcher=matcher)
466
466
467 if overwrite:
467 if overwrite:
468 return actions, diverge, renamedelete
468 return actions, diverge, renamedelete
@@ -841,9 +841,13 b' def _resolvetrivial(repo, wctx, mctx, an'
841 # remote did change but ended up with same content
841 # remote did change but ended up with same content
842 del actions[f] # don't get = keep local deleted
842 del actions[f] # don't get = keep local deleted
843
843
844 def calculateupdates(repo, wctx, mctx, ancestors, branchmerge, force, partial,
844 def calculateupdates(repo, wctx, mctx, ancestors, branchmerge, force,
845 acceptremote, followcopies):
845 acceptremote, followcopies, matcher=None):
846 "Calculate the actions needed to merge mctx into wctx using ancestors"
846 "Calculate the actions needed to merge mctx into wctx using ancestors"
847 if matcher is None or matcher.always():
848 partial = False
849 else:
850 partial = matcher.matchfn
847
851
848 if len(ancestors) == 1: # default
852 if len(ancestors) == 1: # default
849 actions, diverge, renamedelete = manifestmerge(
853 actions, diverge, renamedelete = manifestmerge(
@@ -1414,13 +1418,9 b' def update(repo, node, branchmerge, forc'
1414 followcopies = True
1418 followcopies = True
1415
1419
1416 ### calculate phase
1420 ### calculate phase
1417 if matcher is None or matcher.always():
1418 partial = False
1419 else:
1420 partial = matcher.matchfn
1421 actionbyfile, diverge, renamedelete = calculateupdates(
1421 actionbyfile, diverge, renamedelete = calculateupdates(
1422 repo, wc, p2, pas, branchmerge, force, partial, mergeancestor,
1422 repo, wc, p2, pas, branchmerge, force, mergeancestor,
1423 followcopies)
1423 followcopies, matcher=matcher)
1424 # Convert to dictionary-of-lists format
1424 # Convert to dictionary-of-lists format
1425 actions = dict((m, []) for m in 'a am f g cd dc r dm dg m e k'.split())
1425 actions = dict((m, []) for m in 'a am f g cd dc r dm dg m e k'.split())
1426 for f, (m, args, msg) in actionbyfile.iteritems():
1426 for f, (m, args, msg) in actionbyfile.iteritems():
General Comments 0
You need to be logged in to leave comments. Login now