Debian Codegraph @

tests/test-merge-combination-misc.t

raw
1 Testing recorded "modified" files for merge commit
2 ==================================================
3
4 This file shows what hg says are "modified" files for a merge commit
5 (hg log -T {files}), somewhat exhaustively.
6
7 This file test multiple corner case.
8
9 For merges that involve files contents changing, check test-merge-combination-file-content.t
10
11 For merges that involve executable bit changing, check test-merge-combination-exec-bytes.t
12
13
14 Case with multiple or zero merge ancestors, copies/renames, and identical file contents
15 with different filelog revisions are not currently covered.
16
17 $ . $TESTDIR/testlib/merge-combination-util.sh
18
19 Files modified or cleanly merged, with no greatest common ancestors:
20
21 $ hg init repo; cd repo
22 $ touch a0 b0; hg commit -qAm 0
23 $ hg up -qr null; touch a1 b1; hg commit -qAm 1
24 $ hg merge -qr 0; rm b*; hg commit -qAm 2
25 $ hg log -r . -T '{files}\n'
26 b0 b1
27 $ cd ../
28 $ rm -rf repo
29
30 A few cases of criss-cross merges involving deletions (listing all
31 such merges is probably too much). Both gcas contain $files, so we
32 expect the final merge to behave like a merge with a single gca
33 containing $files.
34
35 $ hg init repo; cd repo
36 $ files="c1 u1 c2 u2"
37 $ touch $files; hg commit -qAm '0 root'
38 $ for f in $files; do echo f > $f; done; hg commit -qAm '1 gca1'
39 $ hg up -qr0; hg revert -qr 1 --all; hg commit -qAm '2 gca2'
40 $ hg up -qr 1; hg merge -qr 2; rm *1; hg commit -qAm '3 p1'
41 $ hg up -qr 2; hg merge -qr 1; rm *2; hg commit -qAm '4 p2'
42 $ hg merge -qr 3; echo f > u1; echo f > u2; rm -f c1 c2
43 $ hg commit -qAm '5 merge with two gcas'
44 $ hg log -r . -T '{files}\n' # expecting u1 u2
45
46 $ cd ../
47 $ rm -rf repo