diff tests/test-fold.t @ 5989:056033a7689f stable

fold: make sure to save commit messages in last-message.txt on rewrites
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 29 Jul 2021 22:45:51 +0300
parents a1dad44fe3da
children 43c4db536990 01154958e0cf
line wrap: on
line diff
--- a/tests/test-fold.t	Wed Aug 04 00:46:06 2021 +0300
+++ b/tests/test-fold.t	Thu Jul 29 22:45:51 2021 +0300
@@ -446,3 +446,34 @@
   2 changesets folded
 
   $ cd ..
+
+Saving the last user-edited message in last-message.txt
+https://bz.mercurial-scm.org/show_bug.cgi?id=6549
+
+  $ hg init issue6549
+  $ cd issue6549
+
+  $ echo A > foo
+  $ hg ci -qAm A
+  $ echo B > foo
+  $ hg ci -m B
+
+  $ cat > editor.sh << 'EOF'
+  > echo 'Big commit message that was crafted with care.' > "$1"
+  > echo '' >> "$1"
+  > echo 'It would be a shame if something happened to it.' >> "$1"
+  > EOF
+  $ HGEDITOR="sh ./editor.sh" hg fold --exact --rev 'all()'
+  2 changesets folded
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg glog
+  @  2: Big commit message that was crafted with care.
+  
+     It would be a shame if something happened to it.
+  $ cat .hg/last-message.txt
+  Big commit message that was crafted with care.
+  
+  It would be a shame if something happened to it.
+
+  $ cd ..