##// END OF EJS Templates
commit: don't use hard-coded `.hg/last-message.txt` path in error message...
Martin von Zweigbergk -
r50042:db3f8e5c stable
parent child Browse files
Show More
@@ -3176,7 +3176,7 b' class localrepository(object):'
3176 # Save commit message in case this transaction gets rolled back
3176 # Save commit message in case this transaction gets rolled back
3177 # (e.g. by a pretxncommit hook). Leave the content alone on
3177 # (e.g. by a pretxncommit hook). Leave the content alone on
3178 # the assumption that the user will use the same editor again.
3178 # the assumption that the user will use the same editor again.
3179 msgfn = self.savecommitmessage(cctx._text)
3179 msg_path = self.savecommitmessage(cctx._text)
3180
3180
3181 # commit subs and write new state
3181 # commit subs and write new state
3182 if subs:
3182 if subs:
@@ -3206,13 +3206,14 b' class localrepository(object):'
3206 except: # re-raises
3206 except: # re-raises
3207 if edited:
3207 if edited:
3208 self.ui.write(
3208 self.ui.write(
3209 _(b'note: commit message saved in %s\n') % msgfn
3209 _(b'note: commit message saved in %s\n') % msg_path
3210 )
3210 )
3211 self.ui.write(
3211 self.ui.write(
3212 _(
3212 _(
3213 b"note: use 'hg commit --logfile "
3213 b"note: use 'hg commit --logfile "
3214 b".hg/last-message.txt --edit' to reuse it\n"
3214 b"%s --edit' to reuse it\n"
3215 )
3215 )
3216 % msg_path
3216 )
3217 )
3217 raise
3218 raise
3218
3219
@@ -356,6 +356,8 b' check saving last-message.txt, at first'
356 A f
356 A f
357
357
358 $ rm -f .hg/last-message.txt
358 $ rm -f .hg/last-message.txt
359 $ mkdir dir
360 $ cd dir
359 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF
361 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF
360 > mess 1fd3b2fe7754 f
362 > mess 1fd3b2fe7754 f
361 > EOF
363 > EOF
@@ -372,10 +374,11 b' check saving last-message.txt, at first'
372 ====
374 ====
373 transaction abort!
375 transaction abort!
374 rollback completed
376 rollback completed
375 note: commit message saved in .hg/last-message.txt
377 note: commit message saved in ../.hg/last-message.txt
376 note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it
378 note: use 'hg commit --logfile ../.hg/last-message.txt --edit' to reuse it
377 abort: pretxncommit.unexpectedabort hook exited with status 1
379 abort: pretxncommit.unexpectedabort hook exited with status 1
378 [40]
380 [40]
381 $ cd ..
379 $ cat .hg/last-message.txt
382 $ cat .hg/last-message.txt
380 f
383 f
381
384
General Comments 0
You need to be logged in to leave comments. Login now