use comments to combine commit messages in fold compat-hg2.3
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 22 Nov 2012 11:30:36 +0100
branchcompat-hg2.3
changeset 620 232536f5c987
parent 619 f50f8da7a077
child 621 e50a5d9a6cbf
child 623 07d813af96c4
use comments to combine commit messages in fold
hgext/evolve.py
tests/test-evolve.t
--- a/hgext/evolve.py	Mon Nov 26 11:59:40 2012 +0100
+++ b/hgext/evolve.py	Thu Nov 22 11:30:36 2012 +0100
@@ -2222,8 +2222,10 @@
         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)
-            commitopts = {'message': msg}
+            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()],
--- a/tests/test-evolve.t	Mon Nov 26 11:59:40 2012 +0100
+++ b/tests/test-evolve.t	Thu Nov 22 11:30:36 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