comparison mercurial/commands.py @ 20767:bcfc4f625e57 stable

tag: save manually edited commit message into ".hg/last-message.txt" Before this patch, manually edited commit message for "hg tag -e" isn't saved into ".hg/last-message.txt" until it is saved by "localrepository.savecommitmessage()" in "localrepository.commit()". This may lose such commit message, if unexpected exception is raised. This patch saves manually edited commit message for "hg tag -e" into ".hg/last-message.txt" just after user editing. This patch doesn't save the message specified by -m option (-l is not supported for "hg tag") as same as other commands. This is the simplest implementation to fix on stable. Editing and saving commit message should be centralized into the framework of "localrepository.commit()" with "editor" argument in the future.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 19 Mar 2014 01:07:41 +0900
parents b0153cb8b64e
children 03774a2b6991
comparison
equal deleted inserted replaced
20766:95aab23a806b 20767:bcfc4f625e57
5692 if date: 5692 if date:
5693 date = util.parsedate(date) 5693 date = util.parsedate(date)
5694 5694
5695 if opts.get('edit'): 5695 if opts.get('edit'):
5696 message = ui.edit(message, ui.username()) 5696 message = ui.edit(message, ui.username())
5697 repo.savecommitmessage(message)
5697 5698
5698 # don't allow tagging the null rev 5699 # don't allow tagging the null rev
5699 if (not opts.get('remove') and 5700 if (not opts.get('remove') and
5700 scmutil.revsingle(repo, rev_).rev() == nullrev): 5701 scmutil.revsingle(repo, rev_).rev() == nullrev):
5701 raise util.Abort(_("cannot tag null revision")) 5702 raise util.Abort(_("cannot tag null revision"))