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