@@ -413,7 +413,7 @@ def applychanges(ui, repo, ctx, opts):
repo.ui.setconfig('ui', 'forcemerge', '', 'histedit')
return stats
-def collapse(repo, first, last, commitopts):
+def collapse(repo, first, last, commitopts, skipprompt=False):
"""collapse the set of revisions from first to last as new one.
Expected commit options are:
@@ -474,7 +474,7 @@ def collapse(repo, first, last, commitop
parents = (first.p1().node(), first.p2().node())
editor = None
- if not commitopts.get('rollup'):
+ if not skipprompt:
editor = cmdutil.getcommiteditor(edit=True, editform='histedit.fold')
new = context.memctx(repo,
parents=parents,
@@ -575,7 +575,8 @@ class fold(histeditaction):
try:
phasemin = max(ctx.phase(), oldctx.phase())
repo.ui.setconfig('phases', 'new-commit', phasemin, 'histedit')
- n = collapse(repo, ctx, repo[newnode], commitopts)
+ n = collapse(repo, ctx, repo[newnode], commitopts,
+ skipprompt=self.skipprompt())
finally:
repo.ui.restoreconfig(phasebackup)
if n is None:
@@ -107,6 +107,8 @@ check histedit_source
rollup will fold without preserving the folded commit's message
+ $ OLDHGEDITOR=$HGEDITOR
+ $ HGEDITOR=false
$ hg histedit d2ae7f538514 --commands - 2>&1 <<EOF | fixbundle
> pick d2ae7f538514 b
> roll ee283cb5f2d5 e
@@ -120,6 +122,8 @@ rollup will fold without preserving the
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ HGEDITOR=$OLDHGEDITOR
+
log after edit
$ hg logt --graph
@ 3:c4a9eb7989fc d