comparison tests/test-histedit-fold.t @ 31056:37ab9e20991c

histedit: modify rollup to discard date from the rollup commit (issue4820) This change adjusts and documents the new behaviour of 'roll'. It now fits nicely with the behaviour of 'commit --amend' and the 'edit' action, by discarding the date as well as the commit message of the second commit. Previously it used the later date, like 'fold', but this often wasn't desirable, for example, in the common use case of using 'roll' to add forgotten changes to a changeset (because 'hg add' was previously forgotten or not all changes were identified while using 'hg record').
author Ben Schmidt <insightfuls@users.noreply.github.com>
date Sat, 18 Feb 2017 21:30:28 +1100
parents f1b63ec4b987
children bd872f64a8ba
comparison
equal deleted inserted replaced
31055:f1b63ec4b987 31056:37ab9e20991c
104 *** 104 ***
105 c 105 c
106 106
107 107
108 108
109 rollup will fold without preserving the folded commit's message 109 rollup will fold without preserving the folded commit's message or date
110 110
111 $ OLDHGEDITOR=$HGEDITOR 111 $ OLDHGEDITOR=$HGEDITOR
112 $ HGEDITOR=false 112 $ HGEDITOR=false
113 $ hg histedit 97d72e5f12c7 --commands - 2>&1 <<EOF | fixbundle 113 $ hg histedit 97d72e5f12c7 --commands - 2>&1 <<EOF | fixbundle
114 > pick 97d72e5f12c7 b 114 > pick 97d72e5f12c7 b
119 119
120 $ HGEDITOR=$OLDHGEDITOR 120 $ HGEDITOR=$OLDHGEDITOR
121 121
122 log after edit 122 log after edit
123 $ hg logt --graph 123 $ hg logt --graph
124 @ 3:fb13f1f49340 d 124 @ 3:bab801520cec d
125 | 125 |
126 o 2:6d4bc3727566 f 126 o 2:58c8f2bfc151 f
127 | 127 |
128 o 1:563995ddbe65 b 128 o 1:5d939c56c72e b
129 | 129 |
130 o 0:8580ff50825a a 130 o 0:8580ff50825a a
131 131
132 132
133 description is taken from rollup target commit 133 description is taken from rollup target commit
134 134
135 $ hg log --debug --rev 1 135 $ hg log --debug --rev 1
136 changeset: 1:563995ddbe650c0e6b0e1c1d75f0a197b61cec50 136 changeset: 1:5d939c56c72e77e29f5167696218e2131a40f5cf
137 phase: draft 137 phase: draft
138 parent: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab 138 parent: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
139 parent: -1:0000000000000000000000000000000000000000 139 parent: -1:0000000000000000000000000000000000000000
140 manifest: 1:b5e112a3a8354e269b1524729f0918662d847c38 140 manifest: 1:b5e112a3a8354e269b1524729f0918662d847c38
141 user: test 141 user: test
142 date: Thu Jan 01 00:00:05 1970 +0000 142 date: Thu Jan 01 00:00:02 1970 +0000
143 files+: b e 143 files+: b e
144 extra: branch=default 144 extra: branch=default
145 extra: histedit_source=97d72e5f12c7e84f85064aa72e5a297142c36ed9,505a591af19eed18f560af827b9e03d2076773dc 145 extra: histedit_source=97d72e5f12c7e84f85064aa72e5a297142c36ed9,505a591af19eed18f560af827b9e03d2076773dc
146 description: 146 description:
147 b 147 b
169 > echo "====" 169 > echo "===="
170 > echo "check saving last-message.txt" >> \$1 170 > echo "check saving last-message.txt" >> \$1
171 > EOF 171 > EOF
172 172
173 $ rm -f .hg/last-message.txt 173 $ rm -f .hg/last-message.txt
174 $ hg status --rev '6d4bc3727566^1::fb13f1f49340' 174 $ hg status --rev '58c8f2bfc151^1::bab801520cec'
175 A c 175 A c
176 A d 176 A d
177 A f 177 A f
178 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 6d4bc3727566 --commands - 2>&1 <<EOF 178 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 58c8f2bfc151 --commands - 2>&1 <<EOF
179 > pick 6d4bc3727566 f 179 > pick 58c8f2bfc151 f
180 > fold fb13f1f49340 d 180 > fold bab801520cec d
181 > EOF 181 > EOF
182 allow non-folding commit 182 allow non-folding commit
183 ==== before editing 183 ==== before editing
184 f 184 f
185 *** 185 ***