comparison 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
comparison
equal deleted inserted replaced
17907:ce2c709a8e90 17924:45bd0cd7ca04
1713 except KeyError: 1713 except KeyError:
1714 raise IOError 1714 raise IOError
1715 1715
1716 user = opts.get('user') or old.user() 1716 user = opts.get('user') or old.user()
1717 date = opts.get('date') or old.date() 1717 date = opts.get('date') or old.date()
1718 editmsg = False
1718 if not message: 1719 if not message:
1720 editmsg = True
1719 message = old.description() 1721 message = old.description()
1720 1722
1721 pureextra = extra.copy() 1723 pureextra = extra.copy()
1722 extra['amend_source'] = old.hex() 1724 extra['amend_source'] = old.hex()
1723 1725
1727 files=files, 1729 files=files,
1728 filectxfn=filectxfn, 1730 filectxfn=filectxfn,
1729 user=user, 1731 user=user,
1730 date=date, 1732 date=date,
1731 extra=extra) 1733 extra=extra)
1732 new._text = commitforceeditor(repo, new, []) 1734 if editmsg:
1735 new._text = commitforceeditor(repo, new, [])
1733 1736
1734 newdesc = changelog.stripdesc(new.description()) 1737 newdesc = changelog.stripdesc(new.description())
1735 if ((not node) 1738 if ((not node)
1736 and newdesc == old.description() 1739 and newdesc == old.description()
1737 and user == old.user() 1740 and user == old.user()