comparison tests/test-histedit-fold.t @ 22147:9ac98c2aa95c stable

histedit: preserve initial author on fold (issue4296) When the authorship of the changeset folded in does not match that of the base changeset, we currently use the configured ui.username instead. This is especially surprising when the user is not the author of either of the changesets. In such cases, the resulting authorship (the user's) is clearly incorrect. Even when the user is folding in a patch they authored themselves, it's not clear whether they should take over the authorship. Let's instead keep it simple and always preserve the base changeset's authorship. This is also how "git rebase -i" handles folding/squashing.
author Martin von Zweigbergk <martinvonz@gmail.com>
date Wed, 13 Aug 2014 11:50:13 -0700
parents b081decd9062
children 3ddfb9b3fdc6
comparison
equal deleted inserted replaced
22146:58b5196cce20 22147:9ac98c2aa95c
167 167
168 168
169 check saving last-message.txt 169 check saving last-message.txt
170 170
171 $ cd .. 171 $ cd ..
172 $ rm -r r
173
174 folding preserves initial author
175 --------------------------------
176
177 $ initrepo
178
179 $ hg ci --user "someone else" --amend --quiet
180
181 tip before edit
182 $ hg log --rev .
183 changeset: 5:a00ad806cb55
184 tag: tip
185 user: someone else
186 date: Thu Jan 01 00:00:00 1970 +0000
187 summary: f
188
189
190 $ hg histedit e860deea161a --commands - 2>&1 <<EOF | fixbundle
191 > pick e860deea161a e
192 > fold a00ad806cb55 f
193 > EOF
194 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
195 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
196 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
198
199 tip after edit
200 $ hg log --rev .
201 changeset: 4:698d4e8040a1
202 tag: tip
203 user: test
204 date: Thu Jan 01 00:00:00 1970 +0000
205 summary: e
206
207
208 $ cd ..
209 $ rm -r r
172 210
173 folding and creating no new change doesn't break: 211 folding and creating no new change doesn't break:
174 ------------------------------------------------- 212 -------------------------------------------------
175 213
176 folded content is dropped during a merge. The folded commit should properly disappear. 214 folded content is dropped during a merge. The folded commit should properly disappear.