##// END OF EJS Templates
tests: unify test-simplemerge-cmd
Matt Mackall -
r12488:73ad7274 default
parent child Browse files
Show More
@@ -1,61 +1,172 b''
1 #!/bin/sh
2
1
3 cp "$TESTDIR"/../contrib/simplemerge .
2 $ cp "$TESTDIR"/../contrib/simplemerge .
3 $ echo base > base
4 $ echo local > local
5 $ cat base >> local
6 $ cp local orig
7 $ cat base > other
8 $ echo other >> other
4
9
5 echo base > base
10 changing local directly
6
11
7 echo local > local
12 $ python simplemerge local base other && echo "merge succeeded"
8 cat base >> local
13 merge succeeded
9 cp local orig
14 $ cat local
15 local
16 base
17 other
18 $ cp orig local
19
20 printing to stdout
10
21
11 cat base > other
22 $ python simplemerge -p local base other
12 echo other >> other
23 local
24 base
25 other
26
27 local:
28
29 $ cat local
30 local
31 base
32
33 conflicts
13
34
14 echo '% changing local directly'
35 $ cp base conflict-local
15 python simplemerge local base other && echo "merge succeeded"
36 $ cp other conflict-other
16 cat local
37 $ echo not other >> conflict-local
17 cp orig local
38 $ echo end >> conflict-local
39 $ echo end >> conflict-other
40 $ python simplemerge -p conflict-local base conflict-other
41 base
42 <<<<<<< conflict-local
43 not other
44 =======
45 other
46 >>>>>>> conflict-other
47 end
48 warning: conflicts during merge.
49 [1]
50
51 --no-minimal
18
52
19 echo '% printing to stdout'
53 $ python simplemerge -p --no-minimal conflict-local base conflict-other
20 python simplemerge -p local base other
54 base
21 echo ' local:'
55 <<<<<<< conflict-local
22 cat local
56 not other
57 end
58 =======
59 other
60 end
61 >>>>>>> conflict-other
62 warning: conflicts during merge.
63 [1]
23
64
24 echo '% conflicts'
65 1 label
25 cp base conflict-local
66
26 cp other conflict-other
67 $ python simplemerge -p -L foo conflict-local base conflict-other
27 echo not other >> conflict-local
68 base
28 echo end >> conflict-local
69 <<<<<<< foo
29 echo end >> conflict-other
70 not other
30 python simplemerge -p conflict-local base conflict-other || echo "merge failed"
71 =======
72 other
73 >>>>>>> conflict-other
74 end
75 warning: conflicts during merge.
76 [1]
77
78 2 labels
31
79
32 echo '% --no-minimal'
80 $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
33 python simplemerge -p --no-minimal conflict-local base conflict-other
81 base
82 <<<<<<< foo
83 not other
84 =======
85 other
86 >>>>>>> bar
87 end
88 warning: conflicts during merge.
89 [1]
34
90
35 echo '% 1 label'
91 too many labels
36 python simplemerge -p -L foo conflict-local base conflict-other
92
93 $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
94 abort: can only specify two labels.
95 [255]
96
97 binary file
37
98
38 echo '% 2 labels'
99 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
39 python simplemerge -p -L foo -L bar conflict-local base conflict-other
100 $ cat orig >> binary-local
101 $ python simplemerge -p binary-local base other
102 abort: binary-local looks like a binary file.
103 [255]
104
105 binary file --text
40
106
41 echo '% too many labels'
107 $ python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py
42 python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
108 warning: binary-local looks like a binary file.
109 \x00local
110 base
111 other
112
113 help
114
115 $ python simplemerge --help
116 simplemerge [OPTS] LOCAL BASE OTHER
117
118 Simple three-way file merge utility with a minimal feature set.
119
120 Apply to LOCAL the changes necessary to go from BASE to OTHER.
121
122 By default, LOCAL is overwritten with the results of this operation.
43
123
44 echo '% binary file'
124 options:
45 python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
125 -L --label labels to use on conflict markers
46 cat orig >> binary-local
126 -a --text treat all files as text
47 python simplemerge -p binary-local base other
127 -p --print print results instead of overwriting LOCAL
128 --no-minimal do not try to minimize conflict regions
129 -h --help display help and exit
130 -q --quiet suppress output
131
132 wrong number of arguments
48
133
49 echo '% binary file --text'
134 $ python simplemerge
50 python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py
135 simplemerge: wrong number of arguments
136 simplemerge [OPTS] LOCAL BASE OTHER
137
138 Simple three-way file merge utility with a minimal feature set.
139
140 Apply to LOCAL the changes necessary to go from BASE to OTHER.
141
142 By default, LOCAL is overwritten with the results of this operation.
51
143
52 echo '% help'
144 options:
53 python simplemerge --help
145 -L --label labels to use on conflict markers
146 -a --text treat all files as text
147 -p --print print results instead of overwriting LOCAL
148 --no-minimal do not try to minimize conflict regions
149 -h --help display help and exit
150 -q --quiet suppress output
151 [1]
152
153 bad option
154
155 $ python simplemerge --foo -p local base other
156 simplemerge: option --foo not recognized
157 simplemerge [OPTS] LOCAL BASE OTHER
54
158
55 echo '% wrong number of arguments'
159 Simple three-way file merge utility with a minimal feature set.
56 python simplemerge
160
161 Apply to LOCAL the changes necessary to go from BASE to OTHER.
162
163 By default, LOCAL is overwritten with the results of this operation.
57
164
58 echo '% bad option'
165 options:
59 python simplemerge --foo -p local base other
166 -L --label labels to use on conflict markers
60
167 -a --text treat all files as text
61 exit 0
168 -p --print print results instead of overwriting LOCAL
169 --no-minimal do not try to minimize conflict regions
170 -h --help display help and exit
171 -q --quiet suppress output
172 [1]
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now