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