comparison hgext/mq.py @ 20769:1e686e55780c stable

qfold: save manually edited commit message into ".hg/last-message.txt" Before this patch, manually edited commit message for "hg qfold -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 qfold -e" into ".hg/last-message.txt" just after user editing. This patch doesn't save the message specified by -m/-l options 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. This patch uses repository wrapping class for exception raising before saving commit message in "localrepository.commit()" easily and certainly, because such exception requires corner case condition.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 19 Mar 2014 01:07:41 +0900
parents 57d0c8c3b947
children efbf15979538
comparison
equal deleted inserted replaced
20768:57d0c8c3b947 20769:1e686e55780c
2574 message.extend(msg) 2574 message.extend(msg)
2575 message = '\n'.join(message) 2575 message = '\n'.join(message)
2576 2576
2577 if opts.get('edit'): 2577 if opts.get('edit'):
2578 message = ui.edit(message, user or ui.username()) 2578 message = ui.edit(message, user or ui.username())
2579 repo.savecommitmessage(message)
2579 2580
2580 diffopts = q.patchopts(q.diffopts(), *patches) 2581 diffopts = q.patchopts(q.diffopts(), *patches)
2581 wlock = repo.wlock() 2582 wlock = repo.wlock()
2582 try: 2583 try:
2583 q.refresh(repo, msg=message, git=diffopts.git) 2584 q.refresh(repo, msg=message, git=diffopts.git)