comparison mercurial/localrepo.py @ 44733:c6d31e659a28

commit: tell user what to do with .hg/last-message.txt I have always assumed that the message will be reused by the next `hg commit`, but it seems it's just silently dropped on the next commit. Let's try to be more helpful by telling the user that they have to manually tell hg to reuse it. The file will still be lost if the user runs some other operation in between (like a non-in-memory rebase). That will be fixed once we've switched all operations to be in-memory :) I didn't include `$(hg root)/` in the path in the message to the user because that would have made the message too long. Hopefully the user will figure that part out themselves. Differential Revision: https://phab.mercurial-scm.org/D8463
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 20 Apr 2020 14:37:10 -0700
parents 1b8fd4af3318
children 97ebdb192b00
comparison
equal deleted inserted replaced
44732:f44a7d8660ea 44733:c6d31e659a28
3014 except: # re-raises 3014 except: # re-raises
3015 if edited: 3015 if edited:
3016 self.ui.write( 3016 self.ui.write(
3017 _(b'note: commit message saved in %s\n') % msgfn 3017 _(b'note: commit message saved in %s\n') % msgfn
3018 ) 3018 )
3019 self.ui.write(
3020 _(
3021 b"note: use 'hg commit --logfile "
3022 b".hg/last-message.txt --edit' to reuse it\n"
3023 )
3024 )
3019 raise 3025 raise
3020 3026
3021 def commithook(unused_success): 3027 def commithook(unused_success):
3022 # hack for command that use a temporary commit (eg: histedit) 3028 # hack for command that use a temporary commit (eg: histedit)
3023 # temporary commit got stripped before hook release 3029 # temporary commit got stripped before hook release