Show More
@@ -398,6 +398,7 b' def message(ui, repo, ctx, ha, opts):' | |||||
398 | _('Fix up the change and run hg histedit --continue')) |
|
398 | _('Fix up the change and run hg histedit --continue')) | |
399 | message = oldctx.description() + '\n' |
|
399 | message = oldctx.description() + '\n' | |
400 | message = ui.edit(message, ui.username()) |
|
400 | message = ui.edit(message, ui.username()) | |
|
401 | repo.savecommitmessage(message) | |||
401 | commit = commitfuncfor(repo, oldctx) |
|
402 | commit = commitfuncfor(repo, oldctx) | |
402 | new = commit(text=message, user=oldctx.user(), date=oldctx.date(), |
|
403 | new = commit(text=message, user=oldctx.user(), date=oldctx.date(), | |
403 | extra=oldctx.extra()) |
|
404 | extra=oldctx.extra()) |
@@ -189,6 +189,49 b" say we'll change the message, but don't." | |||||
189 |
|
189 | |||
190 |
|
190 | |||
191 | modify the message |
|
191 | modify the message | |
|
192 | ||||
|
193 | check saving last-message.txt, at first | |||
|
194 | ||||
|
195 | $ cat > $TESTTMP/commitfailure.py <<EOF | |||
|
196 | > from mercurial import util | |||
|
197 | > def reposetup(ui, repo): | |||
|
198 | > class commitfailure(repo.__class__): | |||
|
199 | > def commit(self, *args, **kwargs): | |||
|
200 | > raise util.Abort('emulating unexpected abort') | |||
|
201 | > repo.__class__ = commitfailure | |||
|
202 | > EOF | |||
|
203 | $ cat > .hg/hgrc <<EOF | |||
|
204 | > [extensions] | |||
|
205 | > commitfailure = $TESTTMP/commitfailure.py | |||
|
206 | > EOF | |||
|
207 | ||||
|
208 | $ cat > $TESTTMP/editor.sh <<EOF | |||
|
209 | > echo "==== before editing" | |||
|
210 | > cat \$1 | |||
|
211 | > echo "====" | |||
|
212 | > echo "check saving last-message.txt" >> \$1 | |||
|
213 | > EOF | |||
|
214 | $ rm -f .hg/last-message.txt | |||
|
215 | $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF | fixbundle | |||
|
216 | > mess 1fd3b2fe7754 f | |||
|
217 | > EOF | |||
|
218 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
219 | ==== before editing | |||
|
220 | f | |||
|
221 | ==== | |||
|
222 | abort: emulating unexpected abort | |||
|
223 | $ cat .hg/last-message.txt | |||
|
224 | f | |||
|
225 | check saving last-message.txt | |||
|
226 | ||||
|
227 | $ cat > .hg/hgrc <<EOF | |||
|
228 | > [extensions] | |||
|
229 | > commitfailure = ! | |||
|
230 | > EOF | |||
|
231 | $ hg histedit --abort -q | |||
|
232 | ||||
|
233 | then, check "modify the message" itself | |||
|
234 | ||||
192 | $ hg histedit tip --commands - 2>&1 << EOF | fixbundle |
|
235 | $ hg histedit tip --commands - 2>&1 << EOF | fixbundle | |
193 | > mess 1fd3b2fe7754 f |
|
236 | > mess 1fd3b2fe7754 f | |
194 | > EOF |
|
237 | > EOF |
General Comments 0
You need to be logged in to leave comments.
Login now