merge with Denis improvement stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 27 Nov 2012 14:27:50 +0100
branchstable
changeset 621 e50a5d9a6cbf
parent 617 469befc27b26 (current diff)
parent 620 232536f5c987 (diff)
child 622 8cbada2b0c43
child 626 896463193675
merge with Denis improvement
hgext/evolve.py
--- a/hgext/evolve.py	Wed Nov 21 11:14:20 2012 +0100
+++ b/hgext/evolve.py	Tue Nov 27 14:27:50 2012 +0100
@@ -1813,7 +1813,8 @@
         lockmod.release(lock, wlock)
 
 @command('^fold',
-    [('r', 'rev', [], 'revisions to fold'),],
+    [('r', 'rev', [], 'revisions to fold'),
+    ],
     # allow to choose the seed ?
     _('[-r] revs'))
 def fold(ui, repo, *revs, **opts):
@@ -1843,10 +1844,14 @@
         try:
             allctx = [repo[r] for r in revs]
             targetphase = max(c.phase() for c in allctx)
-            msg = '\n\n***\n\n'.join(c.description() for c in allctx)
+            msgs = ["HG: This is a fold of %d changesets." % len(allctx)]
+            msgs += ["HG: Commit message of changeset %s.\n\n%s\n" %
+                     (c.rev(), c.description()) for c in allctx]
+            commitopts = {'message': "\n".join(msgs)}
+            commitopts['edit'] = True
             newid, _ = rewrite(repo, root, allctx, head,
                              [root.p1().node(), root.p2().node()],
-                             commitopts={'message': msg})
+                             commitopts=commitopts)
             phases.retractboundary(repo, targetphase, [newid])
             createmarkers(repo, [(ctx, (repo[newid],))
                                  for ctx in allctx])
--- a/tests/test-evolve.t	Wed Nov 21 11:14:20 2012 +0100
+++ b/tests/test-evolve.t	Tue Nov 27 14:27:50 2012 +0100
@@ -575,7 +575,6 @@
   $ hg log -r 11 --template '{desc}\n'
   add 1
   
-  ***
   
   conflict
   $ hg debugrebuildstate
@@ -598,15 +597,12 @@
   $ hg log -r 12 --template '{desc}\n'
   add 4
   
-  ***
   
   add 3
   
-  ***
   
   add 1
   
-  ***
   
   conflict
   $ hg debugrebuildstate