##// END OF EJS Templates
histedit: rename variables so they have "ctx" in them...
Gregory Szorc -
r36421:10de411d default
parent child Browse files
Show More
@@ -567,7 +567,7 b' def applychanges(ui, repo, ctx, opts):'
567 567 repo.ui.setconfig('ui', 'forcemerge', '', 'histedit')
568 568 return stats
569 569
570 def collapse(repo, first, last, commitopts, skipprompt=False):
570 def collapse(repo, firstctx, lastctx, commitopts, skipprompt=False):
571 571 """collapse the set of revisions from first to last as new one.
572 572
573 573 Expected commit options are:
@@ -577,14 +577,14 b' def collapse(repo, first, last, commitop'
577 577 Commit message is edited in all cases.
578 578
579 579 This function works in memory."""
580 ctxs = list(repo.set('%d::%d', first, last))
580 ctxs = list(repo.set('%d::%d', firstctx, lastctx))
581 581 if not ctxs:
582 582 return None
583 583 for c in ctxs:
584 584 if not c.mutable():
585 585 raise error.ParseError(
586 586 _("cannot fold into public change %s") % node.short(c.node()))
587 base = first.parents()[0]
587 base = firstctx.parents()[0]
588 588
589 589 # commit a new version of the old changeset, including the update
590 590 # collect all files which might be affected
@@ -593,15 +593,15 b' def collapse(repo, first, last, commitop'
593 593 files.update(ctx.files())
594 594
595 595 # Recompute copies (avoid recording a -> b -> a)
596 copied = copies.pathcopies(base, last)
596 copied = copies.pathcopies(base, lastctx)
597 597
598 598 # prune files which were reverted by the updates
599 files = [f for f in files if not cmdutil.samefile(f, last, base)]
599 files = [f for f in files if not cmdutil.samefile(f, lastctx, base)]
600 600 # commit version of these files as defined by head
601 headmf = last.manifest()
601 headmf = lastctx.manifest()
602 602 def filectxfn(repo, ctx, path):
603 603 if path in headmf:
604 fctx = last[path]
604 fctx = lastctx[path]
605 605 flags = fctx.flags()
606 606 mctx = context.memfilectx(repo, ctx,
607 607 fctx.path(), fctx.data(),
@@ -614,12 +614,12 b' def collapse(repo, first, last, commitop'
614 614 if commitopts.get('message'):
615 615 message = commitopts['message']
616 616 else:
617 message = first.description()
617 message = firstctx.description()
618 618 user = commitopts.get('user')
619 619 date = commitopts.get('date')
620 620 extra = commitopts.get('extra')
621 621
622 parents = (first.p1().node(), first.p2().node())
622 parents = (firstctx.p1().node(), firstctx.p2().node())
623 623 editor = None
624 624 if not skipprompt:
625 625 editor = cmdutil.getcommiteditor(edit=True, editform='histedit.fold')
General Comments 0
You need to be logged in to leave comments. Login now