comparison tests/test-metaedit.t @ 4724:77bf84025dd5

metaedit: allow operations on merge commits with some conditions As with fold (see the previous patch), it's allowed to metaedit a merge commit or a set of commits including merge commits (with --fold) as long as there are less than 2 parents of the set not included in the said set.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 13 Jul 2019 18:22:34 +0800
parents cfe31185ad07
children 92d617c7be66
comparison
equal deleted inserted replaced
4723:41885988921e 4724:77bf84025dd5
8 > allow_push = * 8 > allow_push = *
9 > [phases] 9 > [phases]
10 > publish = False 10 > publish = False
11 > [alias] 11 > [alias]
12 > qlog = log --template='{rev} - {node|short} {desc} ({phase})\n' 12 > qlog = log --template='{rev} - {node|short} {desc} ({phase})\n'
13 > gluf = log -GT "{rev}: {desc|firstline} - {author|user} ({files})"
13 > [diff] 14 > [diff]
14 > git = 1 15 > git = 1
15 > unified = 0 16 > unified = 0
16 > [extensions] 17 > [extensions]
17 > EOF 18 > EOF
227 'fold' one commit 228 'fold' one commit
228 $ HGUSER=foobar3 hg metaedit "desc(D2)" --fold -U 229 $ HGUSER=foobar3 hg metaedit "desc(D2)" --fold -U
229 1 changesets folded 230 1 changesets folded
230 $ hg log -r "tip" --template '{rev}: {author}\n' 231 $ hg log -r "tip" --template '{rev}: {author}\n'
231 12: foobar3 232 12: foobar3
233
234 working on merge commits too
235
236 $ hg up -q 11
237 $ hg merge -q 12
238 $ hg ci -m 'merge commit'
239 $ hg st --change .
240 A D
241 $ hg metaedit --user someone-else
242 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 $ hg st --change .
244 A D
245 $ hg gluf
246 @ 14: merge commit - someone-else ()
247 |\
248 | o 12: D2 - foobar3 (D)
249 | |
250 o | 11: E - foobar2 (E F)
251 |/
252 o 3: C - test (C)
253 |
254 | o 2: B - test (B)
255 |/
256 o 1: A - test (A)
257 |
258 o 0: ROOT - test (ROOT)
259
260 $ hg metaedit --user mr-squasher -r 3:14 --fold --message squashed
261 4 changesets folded
262 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 $ hg st --change .
264 A C
265 A D
266 A E
267 A F
268 $ hg gluf
269 @ 15: squashed - mr-squasher (C D E F)
270 |
271 | o 2: B - test (B)
272 |/
273 o 1: A - test (A)
274 |
275 o 0: ROOT - test (ROOT)
276
277 $ hg files
278 A
279 C
280 D
281 E
282 F
283 ROOT