Show More
@@ -162,18 +162,18 b' def _forgetremoved(wctx, mctx, branchmer' | |||
|
162 | 162 | as removed. |
|
163 | 163 | """ |
|
164 | 164 | |
|
165 | action = [] | |
|
165 | actions = [] | |
|
166 | 166 | state = branchmerge and 'r' or 'f' |
|
167 | 167 | for f in wctx.deleted(): |
|
168 | 168 | if f not in mctx: |
|
169 | action.append((f, state)) | |
|
169 | actions.append((f, state)) | |
|
170 | 170 | |
|
171 | 171 | if not branchmerge: |
|
172 | 172 | for f in wctx.removed(): |
|
173 | 173 | if f not in mctx: |
|
174 | action.append((f, "f")) | |
|
174 | actions.append((f, "f")) | |
|
175 | 175 | |
|
176 | return action | |
|
176 | return actions | |
|
177 | 177 | |
|
178 | 178 | def manifestmerge(repo, p1, p2, pa, overwrite, partial): |
|
179 | 179 | """ |
@@ -211,9 +211,9 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
211 | 211 | |
|
212 | 212 | def act(msg, m, f, *args): |
|
213 | 213 | repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m)) |
|
214 | action.append((f, m) + args) | |
|
214 | actions.append((f, m) + args) | |
|
215 | 215 | |
|
216 | action, copy, movewithdir = [], {}, {} | |
|
216 | actions, copy, movewithdir = [], {}, {} | |
|
217 | 217 | |
|
218 | 218 | if overwrite: |
|
219 | 219 | pa = p1 |
@@ -315,12 +315,12 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
315 | 315 | (_("&Changed"), _("&Deleted")), 0) == 0: |
|
316 | 316 | act("prompt recreating", "g", f, m2.flags(f)) |
|
317 | 317 | |
|
318 | return action | |
|
318 | return actions | |
|
319 | 319 | |
|
320 | 320 | def actionkey(a): |
|
321 | 321 | return a[1] == "r" and -1 or 0, a |
|
322 | 322 | |
|
323 | def applyupdates(repo, action, wctx, mctx, actx, overwrite): | |
|
323 | def applyupdates(repo, actions, wctx, mctx, actx, overwrite): | |
|
324 | 324 | """apply the merge action list to the working directory |
|
325 | 325 | |
|
326 | 326 | wctx is the working copy context |
@@ -335,10 +335,10 b' def applyupdates(repo, action, wctx, mct' | |||
|
335 | 335 | ms = mergestate(repo) |
|
336 | 336 | ms.reset(wctx.p1().node()) |
|
337 | 337 | moves = [] |
|
338 | action.sort(key=actionkey) | |
|
338 | actions.sort(key=actionkey) | |
|
339 | 339 | |
|
340 | 340 | # prescan for merges |
|
341 | for a in action: | |
|
341 | for a in actions: | |
|
342 | 342 | f, m = a[:2] |
|
343 | 343 | if m == "m": # merge |
|
344 | 344 | f2, fd, flags, move = a[2:] |
@@ -369,8 +369,8 b' def applyupdates(repo, action, wctx, mct' | |||
|
369 | 369 | audit(f) |
|
370 | 370 | os.unlink(repo.wjoin(f)) |
|
371 | 371 | |
|
372 | numupdates = len(action) | |
|
373 | for i, a in enumerate(action): | |
|
372 | numupdates = len(actions) | |
|
373 | for i, a in enumerate(actions): | |
|
374 | 374 | f, m = a[:2] |
|
375 | 375 | repo.ui.progress(_('updating'), i + 1, item=f, total=numupdates, |
|
376 | 376 | unit=_('files')) |
@@ -452,7 +452,7 b' def applyupdates(repo, action, wctx, mct' | |||
|
452 | 452 | |
|
453 | 453 | def calculateupdates(repo, tctx, mctx, ancestor, branchmerge, force, partial): |
|
454 | 454 | "Calculate the actions needed to merge mctx into tctx" |
|
455 | action = [] | |
|
455 | actions = [] | |
|
456 | 456 | folding = not util.checkcase(repo.path) |
|
457 | 457 | if folding: |
|
458 | 458 | # collision check is not needed for clean update |
@@ -464,17 +464,17 b' def calculateupdates(repo, tctx, mctx, a' | |||
|
464 | 464 | if not force: |
|
465 | 465 | _checkunknown(repo, tctx, mctx) |
|
466 | 466 | if tctx.rev() is None: |
|
467 | action += _forgetremoved(tctx, mctx, branchmerge) | |
|
468 | action += manifestmerge(repo, tctx, mctx, | |
|
467 | actions += _forgetremoved(tctx, mctx, branchmerge) | |
|
468 | actions += manifestmerge(repo, tctx, mctx, | |
|
469 | 469 | ancestor, |
|
470 | 470 | force and not branchmerge, |
|
471 | 471 | partial) |
|
472 | return action | |
|
472 | return actions | |
|
473 | 473 | |
|
474 | def recordupdates(repo, action, branchmerge): | |
|
474 | def recordupdates(repo, actions, branchmerge): | |
|
475 | 475 | "record merge actions to the dirstate" |
|
476 | 476 | |
|
477 | for a in action: | |
|
477 | for a in actions: | |
|
478 | 478 | f, m = a[:2] |
|
479 | 479 | if m == "r": # remove |
|
480 | 480 | if branchmerge: |
@@ -632,7 +632,8 b' def update(repo, node, branchmerge, forc' | |||
|
632 | 632 | pa = p1 |
|
633 | 633 | |
|
634 | 634 | ### calculate phase |
|
635 |
action = calculateupdates(repo, wc, p2, pa, |
|
|
635 | actions = calculateupdates(repo, wc, p2, pa, | |
|
636 | branchmerge, force, partial) | |
|
636 | 637 | |
|
637 | 638 | ### apply phase |
|
638 | 639 | if not branchmerge: # just jump to the new rev |
@@ -640,11 +641,11 b' def update(repo, node, branchmerge, forc' | |||
|
640 | 641 | if not partial: |
|
641 | 642 | repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2) |
|
642 | 643 | |
|
643 | stats = applyupdates(repo, action, wc, p2, pa, overwrite) | |
|
644 | stats = applyupdates(repo, actions, wc, p2, pa, overwrite) | |
|
644 | 645 | |
|
645 | 646 | if not partial: |
|
646 | 647 | repo.setparents(fp1, fp2) |
|
647 | recordupdates(repo, action, branchmerge) | |
|
648 | recordupdates(repo, actions, branchmerge) | |
|
648 | 649 | if not branchmerge: |
|
649 | 650 | repo.dirstate.setbranch(p2.branch()) |
|
650 | 651 | finally: |
General Comments 0
You need to be logged in to leave comments.
Login now