diff mercurial/cmdutil.py @ 17924:45bd0cd7ca04 stable

amend: force editor only if old message is reused (issue3698) This regression was added by 9732473aa24b. It triggered the editor even if --message or --logfile were provided.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 13 Nov 2012 08:41:56 -0800
parents 8f85151ce201
children c8ffde272653 0c10cf819146
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Fri Nov 02 20:47:03 2012 +0100
+++ b/mercurial/cmdutil.py	Tue Nov 13 08:41:56 2012 -0800
@@ -1715,7 +1715,9 @@
 
                 user = opts.get('user') or old.user()
                 date = opts.get('date') or old.date()
+            editmsg = False
             if not message:
+                editmsg = True
                 message = old.description()
 
             pureextra = extra.copy()
@@ -1729,7 +1731,8 @@
                                  user=user,
                                  date=date,
                                  extra=extra)
-            new._text = commitforceeditor(repo, new, [])
+            if editmsg:
+                new._text = commitforceeditor(repo, new, [])
 
             newdesc =  changelog.stripdesc(new.description())
             if ((not node)