##// END OF EJS Templates
merge: make all action tuples have the same length - keep args as tuple
Mads Kiilerich -
r18540:139529b0 default
parent child Browse files
Show More
@@ -368,7 +368,7 b' def overridemanifestmerge(origfn, repo, '
368 368 if overwrite:
369 369 processed.append(action)
370 370 continue
371 f, m = action[:2]
371 f, m, args = action
372 372
373 373 choices = (_('&Largefile'), _('&Normal file'))
374 374 if m == "g" and lfutil.splitstandin(f) in p1 and f in p2:
@@ -379,10 +379,10 b' def overridemanifestmerge(origfn, repo, '
379 379 msg = _('%s has been turned into a largefile\n'
380 380 'use (l)argefile or keep as (n)ormal file?') % lfile
381 381 if repo.ui.promptchoice(msg, choices, 0) == 0:
382 processed.append((lfile, "r"))
383 processed.append((standin, "g", p2.flags(standin)))
382 processed.append((lfile, "r", None))
383 processed.append((standin, "g", (p2.flags(standin),)))
384 384 else:
385 processed.append((standin, "r"))
385 processed.append((standin, "r", None))
386 386 elif m == "g" and lfutil.standin(f) in p1 and f in p2:
387 387 # Case 2: largefile in the working copy, normal file in
388 388 # the second parent
@@ -391,10 +391,10 b' def overridemanifestmerge(origfn, repo, '
391 391 msg = _('%s has been turned into a normal file\n'
392 392 'keep as (l)argefile or use (n)ormal file?') % lfile
393 393 if repo.ui.promptchoice(msg, choices, 0) == 0:
394 processed.append((lfile, "r"))
394 processed.append((lfile, "r", None))
395 395 else:
396 processed.append((standin, "r"))
397 processed.append((lfile, "g", p2.flags(lfile)))
396 processed.append((standin, "r", None))
397 processed.append((lfile, "g", (p2.flags(lfile),)))
398 398 else:
399 399 processed.append(action)
400 400
@@ -176,12 +176,12 b' def _forgetremoved(wctx, mctx, branchmer'
176 176 state = branchmerge and 'r' or 'f'
177 177 for f in wctx.deleted():
178 178 if f not in mctx:
179 actions.append((f, state))
179 actions.append((f, state, None))
180 180
181 181 if not branchmerge:
182 182 for f in wctx.removed():
183 183 if f not in mctx:
184 actions.append((f, "f"))
184 actions.append((f, "f", None))
185 185
186 186 return actions
187 187
@@ -195,7 +195,7 b' def manifestmerge(repo, p1, p2, pa, over'
195 195
196 196 def act(msg, m, f, *args):
197 197 repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
198 actions.append((f, m) + args)
198 actions.append((f, m, args))
199 199
200 200 actions, copy, movewithdir = [], {}, {}
201 201
@@ -342,9 +342,9 b' def applyupdates(repo, actions, wctx, mc'
342 342
343 343 # prescan for merges
344 344 for a in actions:
345 f, m = a[:2]
345 f, m, args = a
346 346 if m == "m": # merge
347 f2, fd, move = a[2:]
347 f2, fd, move = args
348 348 if fd == '.hgsubstate': # merged internally
349 349 continue
350 350 repo.ui.debug("preserving %s for resolve of %s\n" % (f, fd))
@@ -374,7 +374,7 b' def applyupdates(repo, actions, wctx, mc'
374 374
375 375 numupdates = len(actions)
376 376 for i, a in enumerate(actions):
377 f, m = a[:2]
377 f, m, args = a
378 378 repo.ui.progress(_('updating'), i + 1, item=f, total=numupdates,
379 379 unit=_('files'))
380 380 if m == "r": # remove
@@ -393,7 +393,7 b' def applyupdates(repo, actions, wctx, mc'
393 393 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
394 394 overwrite)
395 395 continue
396 f2, fd, move = a[2:]
396 f2, fd, move = args
397 397 audit(fd)
398 398 r = ms.resolve(fd, wctx, mctx)
399 399 if r is not None and r > 0:
@@ -404,14 +404,14 b' def applyupdates(repo, actions, wctx, mc'
404 404 else:
405 405 merged += 1
406 406 elif m == "g": # get
407 flags = a[2]
407 flags, = args
408 408 repo.ui.note(_("getting %s\n") % f)
409 409 repo.wwrite(f, mctx.filectx(f).data(), flags)
410 410 updated += 1
411 411 if f == '.hgsubstate': # subrepo states need updating
412 412 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
413 413 elif m == "d": # directory rename
414 f2, fd, flags = a[2:]
414 f2, fd, flags = args
415 415 if f:
416 416 repo.ui.note(_("moving %s to %s\n") % (f, fd))
417 417 audit(f)
@@ -422,19 +422,19 b' def applyupdates(repo, actions, wctx, mc'
422 422 repo.wwrite(fd, mctx.filectx(f2).data(), flags)
423 423 updated += 1
424 424 elif m == "dr": # divergent renames
425 fl = a[2]
425 fl, = args
426 426 repo.ui.warn(_("note: possible conflict - %s was renamed "
427 427 "multiple times to:\n") % f)
428 428 for nf in fl:
429 429 repo.ui.warn(" %s\n" % nf)
430 430 elif m == "rd": # rename and delete
431 fl = a[2]
431 fl, = args
432 432 repo.ui.warn(_("note: possible conflict - %s was deleted "
433 433 "and renamed to:\n") % f)
434 434 for nf in fl:
435 435 repo.ui.warn(" %s\n" % nf)
436 436 elif m == "e": # exec
437 flags = a[2]
437 flags, = args
438 438 audit(f)
439 439 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags)
440 440 updated += 1
@@ -468,7 +468,7 b' def recordupdates(repo, actions, branchm'
468 468 "record merge actions to the dirstate"
469 469
470 470 for a in actions:
471 f, m = a[:2]
471 f, m, args = a
472 472 if m == "r": # remove
473 473 if branchmerge:
474 474 repo.dirstate.remove(f)
@@ -487,7 +487,7 b' def recordupdates(repo, actions, branchm'
487 487 else:
488 488 repo.dirstate.normal(f)
489 489 elif m == "m": # merge
490 f2, fd, move = a[2:]
490 f2, fd, move = args
491 491 if branchmerge:
492 492 # We've done a branch merge, mark this file as merged
493 493 # so that we properly record the merger later
@@ -510,7 +510,7 b' def recordupdates(repo, actions, branchm'
510 510 if move:
511 511 repo.dirstate.drop(f)
512 512 elif m == "d": # directory rename
513 f2, fd, flag = a[2:]
513 f2, fd, flag = args
514 514 if not f2 and f not in repo.dirstate:
515 515 # untracked file moved
516 516 continue
General Comments 0
You need to be logged in to leave comments. Login now