Commits

Pierre-Yves David committed 8cbada2 Merge

merge with Denis improvement

Comments (0)

Files changed (2)

         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):
         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])

tests/test-evolve.t

   $ hg log -r 11 --template '{desc}\n'
   add 1
   
-  ***
   
   conflict
   $ hg debugrebuildstate
   $ hg log -r 12 --template '{desc}\n'
   add 4
   
-  ***
   
   add 3
   
-  ***
   
   add 1
   
-  ***
   
   conflict
   $ hg debugrebuildstate
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.