diff hgext/histedit.py @ 24828:5045a003260b stable

histedit: fix rollup prompting for a commit message (issue4606) Commit 090da03361c5 broke histedit's rollup by causing it to open the editor. Turns out I missed a spot where the rollup option was read. This fixes that and adjusts the test to catch this case.
author Durham Goode <durham@fb.com>
date Mon, 20 Apr 2015 18:44:57 -0700
parents f5416657e661
children 2bb0e6cc39f6
line wrap: on
line diff
--- a/hgext/histedit.py	Mon Apr 20 13:43:10 2015 -0400
+++ b/hgext/histedit.py	Mon Apr 20 18:44:57 2015 -0700
@@ -413,7 +413,7 @@
             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 @@
 
     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 @@
         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: