##// END OF EJS Templates
commit: write last-message.txt with no content modifications....
Greg Ward -
r9949:bc3f762a default
parent child Browse files
Show More
@@ -837,12 +837,10 b' class localrepository(repo.repository):'
837 subrepo.writestate(self, state)
837 subrepo.writestate(self, state)
838
838
839 # Save commit message in case this transaction gets rolled back
839 # Save commit message in case this transaction gets rolled back
840 # (e.g. by a pretxncommit hook). (Save in text mode in case a
840 # (e.g. by a pretxncommit hook). Leave the content alone on
841 # Windows user wants to edit it with Notepad. Normalize
841 # the assumption that the user will use the same editor again.
842 # trailing whitespace so the file always looks the same --
842 msgfile = self.opener('last-message.txt', 'wb')
843 # makes testing easier.)
843 msgfile.write(cctx._text)
844 msgfile = self.opener('last-message.txt', 'w')
845 msgfile.write(cctx._text.rstrip() + '\n')
846 msgfile.close()
844 msgfile.close()
847
845
848 try:
846 try:
@@ -22,7 +22,7 b' hg branch'
22
22
23 echo '% Test issue 1635 (commit message saved)'
23 echo '% Test issue 1635 (commit message saved)'
24 echo '.hg/last-message.txt:'
24 echo '.hg/last-message.txt:'
25 cat .hg/last-message.txt
25 cat .hg/last-message.txt ; echo
26
26
27 echo % Test rollback of hg before issue 902 was fixed
27 echo % Test rollback of hg before issue 902 was fixed
28 hg commit -m "test3"
28 hg commit -m "test3"
@@ -35,7 +35,7 b" echo '% rollback by pretxncommit saves c"
35 echo a >> a
35 echo a >> a
36 hg --config hooks.pretxncommit=/bin/false commit -m"precious commit message"
36 hg --config hooks.pretxncommit=/bin/false commit -m"precious commit message"
37 echo '.hg/last-message.txt:'
37 echo '.hg/last-message.txt:'
38 cat .hg/last-message.txt
38 cat .hg/last-message.txt ; echo
39
39
40 echo '% same thing, but run $EDITOR'
40 echo '% same thing, but run $EDITOR'
41 cat > $HGTMP/editor <<'__EOF__'
41 cat > $HGTMP/editor <<'__EOF__'
General Comments 0
You need to be logged in to leave comments. Login now