comparison tests/test-merge-exec.t @ 44907:bf5ed664f467 stable

flags: introduce explicit testing for merging change to exec flag It turns out that we do not seems to test the simple case for merging exec flag changes. More advanced case are test (merging exec flag without a common ancestors, merging with a symlink, etc…) but not the basic. We are about introduce various fixes to merging flag change across renames, having the most basic case tested first seems useful. note: We are only testing "adding" an exec flag here, not removing it. We introduce basic test on stable and will consolidate them on default. Differential Revision: https://phab.mercurial-scm.org/D8529
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 16 May 2020 20:37:33 +0200
parents
children 9438c84d1dce
comparison
equal deleted inserted replaced
44906:e5043679bfcc 44907:bf5ed664f467
1 ===============================================
2 Testing merge involving change to the exec flag
3 ===============================================
4
5 #require execbit
6
7
8 Initial setup
9 ==============
10
11
12 $ hg init base-repo
13 $ cd base-repo
14 $ cat << EOF > a
15 > 1
16 > 2
17 > 3
18 > 4
19 > 5
20 > 6
21 > 7
22 > 8
23 > 9
24 > EOF
25 $ touch b
26 $ hg add a b
27 $ hg commit -m "initial commit"
28 $ cd ..
29
30 Testing merging mode change
31 ===========================
32
33 setup
34
35 Change on one side, executable bit on the other
36
37 $ hg clone base-repo simple-merge-repo
38 updating to branch default
39 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 $ cd simple-merge-repo
41 $ chmod +x a
42 $ hg ci -m "make a executable, no change"
43 $ [ -x a ] || echo "executable bit not recorded"
44 $ hg up ".^"
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cat << EOF > a
47 > 1
48 > 2
49 > 3
50 > 4
51 > 5
52 > 6
53 > 7
54 > x
55 > 9
56 > EOF
57 $ hg commit -m "edit end of file"
58 created new head
59
60 merge them (from the update side)
61
62 $ hg merge 'desc("make a executable, no change")'
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 (branch merge, don't forget to commit)
65 $ hg st
66 M a
67 $ [ -x a ] || echo "executable bit lost"
68
69 merge them (from the chmod side)
70
71 $ hg up -C 'desc("make a executable, no change")'
72 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 $ hg merge 'desc("edit end of file")'
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 (branch merge, don't forget to commit)
76 $ hg st
77 M a
78 $ [ -x a ] || echo "executable bit lost"
79
80
81 $ cd ..
82