##// END OF EJS Templates
test-convert-svn-sink: rewrite output for svn compatibility...
Augie Fackler -
r8049:99e5f97c default
parent child Browse files
Show More
@@ -1,136 +1,136 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" svn svn-bindings no-outer-repo || exit 80
3 "$TESTDIR/hghave" svn svn-bindings no-outer-repo || exit 80
4
4
5 fixpath()
5 fixpath()
6 {
6 {
7 tr '\\' /
7 tr '\\' /
8 }
8 }
9
9
10 svnupanddisplay()
10 svnupanddisplay()
11 {
11 {
12 (
12 (
13 cd $1;
13 cd $1;
14 svn up;
14 svn up;
15 svn st -v | fixpath
15 svn st -v | fixpath | sed 's/ */ /g'
16 limit=''
16 limit=''
17 if [ $2 -gt 0 ]; then
17 if [ $2 -gt 0 ]; then
18 limit="--limit=$2"
18 limit="--limit=$2"
19 fi
19 fi
20 svn log --xml -v $limit | fixpath | sed 's,<date>.*,<date/>,'
20 svn log --xml -v $limit | fixpath | sed 's,<date>.*,<date/>,' | grep -v 'kind="'
21 )
21 )
22 }
22 }
23
23
24 echo "[extensions]" >> $HGRCPATH
24 echo "[extensions]" >> $HGRCPATH
25 echo "convert = " >> $HGRCPATH
25 echo "convert = " >> $HGRCPATH
26
26
27 hg init a
27 hg init a
28
28
29 echo a > a/a
29 echo a > a/a
30 mkdir -p a/d1/d2
30 mkdir -p a/d1/d2
31 echo b > a/d1/d2/b
31 echo b > a/d1/d2/b
32 echo % add
32 echo % add
33 hg --cwd a ci -d '0 0' -A -m 'add a file'
33 hg --cwd a ci -d '0 0' -A -m 'add a file'
34
34
35 "$TESTDIR/svn-safe-append.py" a a/a
35 "$TESTDIR/svn-safe-append.py" a a/a
36 echo % modify
36 echo % modify
37 hg --cwd a ci -d '1 0' -m 'modify a file'
37 hg --cwd a ci -d '1 0' -m 'modify a file'
38 hg --cwd a tip -q
38 hg --cwd a tip -q
39
39
40 hg convert -d svn a
40 hg convert -d svn a
41 svnupanddisplay a-hg-wc 2
41 svnupanddisplay a-hg-wc 2
42 ls a a-hg-wc
42 ls a a-hg-wc
43 cmp a/a a-hg-wc/a && echo same || echo different
43 cmp a/a a-hg-wc/a && echo same || echo different
44
44
45 hg --cwd a mv a b
45 hg --cwd a mv a b
46 echo % rename
46 echo % rename
47 hg --cwd a ci -d '2 0' -m 'rename a file'
47 hg --cwd a ci -d '2 0' -m 'rename a file'
48 hg --cwd a tip -q
48 hg --cwd a tip -q
49
49
50 hg convert -d svn a
50 hg convert -d svn a
51 svnupanddisplay a-hg-wc 1
51 svnupanddisplay a-hg-wc 1
52 ls a a-hg-wc
52 ls a a-hg-wc
53
53
54 hg --cwd a cp b c
54 hg --cwd a cp b c
55 echo % copy
55 echo % copy
56 hg --cwd a ci -d '3 0' -m 'copy a file'
56 hg --cwd a ci -d '3 0' -m 'copy a file'
57 hg --cwd a tip -q
57 hg --cwd a tip -q
58
58
59 hg convert -d svn a
59 hg convert -d svn a
60 svnupanddisplay a-hg-wc 1
60 svnupanddisplay a-hg-wc 1
61 ls a a-hg-wc
61 ls a a-hg-wc
62
62
63 hg --cwd a rm b
63 hg --cwd a rm b
64 echo % remove
64 echo % remove
65 hg --cwd a ci -d '4 0' -m 'remove a file'
65 hg --cwd a ci -d '4 0' -m 'remove a file'
66 hg --cwd a tip -q
66 hg --cwd a tip -q
67
67
68 hg convert -d svn a
68 hg convert -d svn a
69 svnupanddisplay a-hg-wc 1
69 svnupanddisplay a-hg-wc 1
70 ls a a-hg-wc
70 ls a a-hg-wc
71
71
72 chmod +x a/c
72 chmod +x a/c
73 echo % executable
73 echo % executable
74 hg --cwd a ci -d '5 0' -m 'make a file executable'
74 hg --cwd a ci -d '5 0' -m 'make a file executable'
75 hg --cwd a tip -q
75 hg --cwd a tip -q
76
76
77 hg convert -d svn a
77 hg convert -d svn a
78 svnupanddisplay a-hg-wc 1
78 svnupanddisplay a-hg-wc 1
79 test -x a-hg-wc/c && echo executable || echo not executable
79 test -x a-hg-wc/c && echo executable || echo not executable
80
80
81 echo % executable in new directory
81 echo % executable in new directory
82
82
83 rm -rf a a-hg a-hg-wc
83 rm -rf a a-hg a-hg-wc
84 hg init a
84 hg init a
85
85
86 mkdir a/d1
86 mkdir a/d1
87 echo a > a/d1/a
87 echo a > a/d1/a
88 chmod +x a/d1/a
88 chmod +x a/d1/a
89 hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
89 hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
90
90
91 hg convert -d svn a
91 hg convert -d svn a
92 svnupanddisplay a-hg-wc 1
92 svnupanddisplay a-hg-wc 1
93 test -x a-hg-wc/d1/a && echo executable || echo not executable
93 test -x a-hg-wc/d1/a && echo executable || echo not executable
94
94
95 echo % copy to new directory
95 echo % copy to new directory
96
96
97 mkdir a/d2
97 mkdir a/d2
98 hg --cwd a cp d1/a d2/a
98 hg --cwd a cp d1/a d2/a
99 hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
99 hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
100
100
101 hg convert -d svn a
101 hg convert -d svn a
102 svnupanddisplay a-hg-wc 1
102 svnupanddisplay a-hg-wc 1
103
103
104 echo % branchy history
104 echo % branchy history
105
105
106 hg init b
106 hg init b
107 echo base > b/b
107 echo base > b/b
108 hg --cwd b ci -d '0 0' -Ambase
108 hg --cwd b ci -d '0 0' -Ambase
109
109
110 "$TESTDIR/svn-safe-append.py" left-1 b/b
110 "$TESTDIR/svn-safe-append.py" left-1 b/b
111 echo left-1 > b/left-1
111 echo left-1 > b/left-1
112 hg --cwd b ci -d '1 0' -Amleft-1
112 hg --cwd b ci -d '1 0' -Amleft-1
113
113
114 "$TESTDIR/svn-safe-append.py" left-2 b/b
114 "$TESTDIR/svn-safe-append.py" left-2 b/b
115 echo left-2 > b/left-2
115 echo left-2 > b/left-2
116 hg --cwd b ci -d '2 0' -Amleft-2
116 hg --cwd b ci -d '2 0' -Amleft-2
117
117
118 hg --cwd b up 0
118 hg --cwd b up 0
119
119
120 "$TESTDIR/svn-safe-append.py" right-1 b/b
120 "$TESTDIR/svn-safe-append.py" right-1 b/b
121 echo right-1 > b/right-1
121 echo right-1 > b/right-1
122 hg --cwd b ci -d '3 0' -Amright-1
122 hg --cwd b ci -d '3 0' -Amright-1
123
123
124 "$TESTDIR/svn-safe-append.py" right-2 b/b
124 "$TESTDIR/svn-safe-append.py" right-2 b/b
125 echo right-2 > b/right-2
125 echo right-2 > b/right-2
126 hg --cwd b ci -d '4 0' -Amright-2
126 hg --cwd b ci -d '4 0' -Amright-2
127
127
128 hg --cwd b up -C 2
128 hg --cwd b up -C 2
129 hg --cwd b merge
129 hg --cwd b merge
130 hg --cwd b revert -r 2 b
130 hg --cwd b revert -r 2 b
131 hg resolve -m b
131 hg resolve -m b
132 hg --cwd b ci -d '5 0' -m 'merge'
132 hg --cwd b ci -d '5 0' -m 'merge'
133
133
134 hg convert -d svn b
134 hg convert -d svn b
135 echo % expect 4 changes
135 echo % expect 4 changes
136 svnupanddisplay b-hg-wc 0
136 svnupanddisplay b-hg-wc 0
@@ -1,337 +1,337 b''
1 % add
1 % add
2 adding a
2 adding a
3 adding d1/d2/b
3 adding d1/d2/b
4 % modify
4 % modify
5 1:e0e2b8a9156b
5 1:e0e2b8a9156b
6 assuming destination a-hg
6 assuming destination a-hg
7 initializing svn repo 'a-hg'
7 initializing svn repo 'a-hg'
8 initializing svn wc 'a-hg-wc'
8 initializing svn wc 'a-hg-wc'
9 scanning source...
9 scanning source...
10 sorting...
10 sorting...
11 converting...
11 converting...
12 1 add a file
12 1 add a file
13 0 modify a file
13 0 modify a file
14 At revision 2.
14 At revision 2.
15 2 2 test .
15 2 2 test .
16 2 2 test a
16 2 2 test a
17 2 1 test d1
17 2 1 test d1
18 2 1 test d1/d2
18 2 1 test d1/d2
19 2 1 test d1/d2/b
19 2 1 test d1/d2/b
20 <?xml version="1.0"?>
20 <?xml version="1.0"?>
21 <log>
21 <log>
22 <logentry
22 <logentry
23 revision="2">
23 revision="2">
24 <author>test</author>
24 <author>test</author>
25 <date/>
25 <date/>
26 <paths>
26 <paths>
27 <path
27 <path
28 action="M">/a</path>
28 action="M">/a</path>
29 </paths>
29 </paths>
30 <msg>modify a file</msg>
30 <msg>modify a file</msg>
31 </logentry>
31 </logentry>
32 <logentry
32 <logentry
33 revision="1">
33 revision="1">
34 <author>test</author>
34 <author>test</author>
35 <date/>
35 <date/>
36 <paths>
36 <paths>
37 <path
37 <path
38 action="A">/a</path>
38 action="A">/a</path>
39 <path
39 <path
40 action="A">/d1</path>
40 action="A">/d1</path>
41 <path
41 <path
42 action="A">/d1/d2</path>
42 action="A">/d1/d2</path>
43 <path
43 <path
44 action="A">/d1/d2/b</path>
44 action="A">/d1/d2/b</path>
45 </paths>
45 </paths>
46 <msg>add a file</msg>
46 <msg>add a file</msg>
47 </logentry>
47 </logentry>
48 </log>
48 </log>
49 a:
49 a:
50 a
50 a
51 d1
51 d1
52
52
53 a-hg-wc:
53 a-hg-wc:
54 a
54 a
55 d1
55 d1
56 same
56 same
57 % rename
57 % rename
58 2:7009fc4efb34
58 2:7009fc4efb34
59 assuming destination a-hg
59 assuming destination a-hg
60 initializing svn wc 'a-hg-wc'
60 initializing svn wc 'a-hg-wc'
61 scanning source...
61 scanning source...
62 sorting...
62 sorting...
63 converting...
63 converting...
64 0 rename a file
64 0 rename a file
65 At revision 3.
65 At revision 3.
66 3 3 test .
66 3 3 test .
67 3 3 test b
67 3 3 test b
68 3 1 test d1
68 3 1 test d1
69 3 1 test d1/d2
69 3 1 test d1/d2
70 3 1 test d1/d2/b
70 3 1 test d1/d2/b
71 <?xml version="1.0"?>
71 <?xml version="1.0"?>
72 <log>
72 <log>
73 <logentry
73 <logentry
74 revision="3">
74 revision="3">
75 <author>test</author>
75 <author>test</author>
76 <date/>
76 <date/>
77 <paths>
77 <paths>
78 <path
78 <path
79 action="D">/a</path>
79 action="D">/a</path>
80 <path
80 <path
81 copyfrom-path="/a"
81 copyfrom-path="/a"
82 copyfrom-rev="2"
82 copyfrom-rev="2"
83 action="A">/b</path>
83 action="A">/b</path>
84 </paths>
84 </paths>
85 <msg>rename a file</msg>
85 <msg>rename a file</msg>
86 </logentry>
86 </logentry>
87 </log>
87 </log>
88 a:
88 a:
89 b
89 b
90 d1
90 d1
91
91
92 a-hg-wc:
92 a-hg-wc:
93 b
93 b
94 d1
94 d1
95 % copy
95 % copy
96 3:56c519973ce6
96 3:56c519973ce6
97 assuming destination a-hg
97 assuming destination a-hg
98 initializing svn wc 'a-hg-wc'
98 initializing svn wc 'a-hg-wc'
99 scanning source...
99 scanning source...
100 sorting...
100 sorting...
101 converting...
101 converting...
102 0 copy a file
102 0 copy a file
103 At revision 4.
103 At revision 4.
104 4 4 test .
104 4 4 test .
105 4 3 test b
105 4 3 test b
106 4 4 test c
106 4 4 test c
107 4 1 test d1
107 4 1 test d1
108 4 1 test d1/d2
108 4 1 test d1/d2
109 4 1 test d1/d2/b
109 4 1 test d1/d2/b
110 <?xml version="1.0"?>
110 <?xml version="1.0"?>
111 <log>
111 <log>
112 <logentry
112 <logentry
113 revision="4">
113 revision="4">
114 <author>test</author>
114 <author>test</author>
115 <date/>
115 <date/>
116 <paths>
116 <paths>
117 <path
117 <path
118 copyfrom-path="/b"
118 copyfrom-path="/b"
119 copyfrom-rev="3"
119 copyfrom-rev="3"
120 action="A">/c</path>
120 action="A">/c</path>
121 </paths>
121 </paths>
122 <msg>copy a file</msg>
122 <msg>copy a file</msg>
123 </logentry>
123 </logentry>
124 </log>
124 </log>
125 a:
125 a:
126 b
126 b
127 c
127 c
128 d1
128 d1
129
129
130 a-hg-wc:
130 a-hg-wc:
131 b
131 b
132 c
132 c
133 d1
133 d1
134 % remove
134 % remove
135 4:ed4dc9a6f585
135 4:ed4dc9a6f585
136 assuming destination a-hg
136 assuming destination a-hg
137 initializing svn wc 'a-hg-wc'
137 initializing svn wc 'a-hg-wc'
138 scanning source...
138 scanning source...
139 sorting...
139 sorting...
140 converting...
140 converting...
141 0 remove a file
141 0 remove a file
142 At revision 5.
142 At revision 5.
143 5 5 test .
143 5 5 test .
144 5 4 test c
144 5 4 test c
145 5 1 test d1
145 5 1 test d1
146 5 1 test d1/d2
146 5 1 test d1/d2
147 5 1 test d1/d2/b
147 5 1 test d1/d2/b
148 <?xml version="1.0"?>
148 <?xml version="1.0"?>
149 <log>
149 <log>
150 <logentry
150 <logentry
151 revision="5">
151 revision="5">
152 <author>test</author>
152 <author>test</author>
153 <date/>
153 <date/>
154 <paths>
154 <paths>
155 <path
155 <path
156 action="D">/b</path>
156 action="D">/b</path>
157 </paths>
157 </paths>
158 <msg>remove a file</msg>
158 <msg>remove a file</msg>
159 </logentry>
159 </logentry>
160 </log>
160 </log>
161 a:
161 a:
162 c
162 c
163 d1
163 d1
164
164
165 a-hg-wc:
165 a-hg-wc:
166 c
166 c
167 d1
167 d1
168 % executable
168 % executable
169 5:f205b3636d77
169 5:f205b3636d77
170 assuming destination a-hg
170 assuming destination a-hg
171 initializing svn wc 'a-hg-wc'
171 initializing svn wc 'a-hg-wc'
172 scanning source...
172 scanning source...
173 sorting...
173 sorting...
174 converting...
174 converting...
175 0 make a file executable
175 0 make a file executable
176 At revision 6.
176 At revision 6.
177 6 6 test .
177 6 6 test .
178 6 6 test c
178 6 6 test c
179 6 1 test d1
179 6 1 test d1
180 6 1 test d1/d2
180 6 1 test d1/d2
181 6 1 test d1/d2/b
181 6 1 test d1/d2/b
182 <?xml version="1.0"?>
182 <?xml version="1.0"?>
183 <log>
183 <log>
184 <logentry
184 <logentry
185 revision="6">
185 revision="6">
186 <author>test</author>
186 <author>test</author>
187 <date/>
187 <date/>
188 <paths>
188 <paths>
189 <path
189 <path
190 action="M">/c</path>
190 action="M">/c</path>
191 </paths>
191 </paths>
192 <msg>make a file executable</msg>
192 <msg>make a file executable</msg>
193 </logentry>
193 </logentry>
194 </log>
194 </log>
195 executable
195 executable
196 % executable in new directory
196 % executable in new directory
197 adding d1/a
197 adding d1/a
198 assuming destination a-hg
198 assuming destination a-hg
199 initializing svn repo 'a-hg'
199 initializing svn repo 'a-hg'
200 initializing svn wc 'a-hg-wc'
200 initializing svn wc 'a-hg-wc'
201 scanning source...
201 scanning source...
202 sorting...
202 sorting...
203 converting...
203 converting...
204 0 add executable file in new directory
204 0 add executable file in new directory
205 At revision 1.
205 At revision 1.
206 1 1 test .
206 1 1 test .
207 1 1 test d1
207 1 1 test d1
208 1 1 test d1/a
208 1 1 test d1/a
209 <?xml version="1.0"?>
209 <?xml version="1.0"?>
210 <log>
210 <log>
211 <logentry
211 <logentry
212 revision="1">
212 revision="1">
213 <author>test</author>
213 <author>test</author>
214 <date/>
214 <date/>
215 <paths>
215 <paths>
216 <path
216 <path
217 action="A">/d1</path>
217 action="A">/d1</path>
218 <path
218 <path
219 action="A">/d1/a</path>
219 action="A">/d1/a</path>
220 </paths>
220 </paths>
221 <msg>add executable file in new directory</msg>
221 <msg>add executable file in new directory</msg>
222 </logentry>
222 </logentry>
223 </log>
223 </log>
224 executable
224 executable
225 % copy to new directory
225 % copy to new directory
226 assuming destination a-hg
226 assuming destination a-hg
227 initializing svn wc 'a-hg-wc'
227 initializing svn wc 'a-hg-wc'
228 scanning source...
228 scanning source...
229 sorting...
229 sorting...
230 converting...
230 converting...
231 0 copy file to new directory
231 0 copy file to new directory
232 At revision 2.
232 At revision 2.
233 2 2 test .
233 2 2 test .
234 2 1 test d1
234 2 1 test d1
235 2 1 test d1/a
235 2 1 test d1/a
236 2 2 test d2
236 2 2 test d2
237 2 2 test d2/a
237 2 2 test d2/a
238 <?xml version="1.0"?>
238 <?xml version="1.0"?>
239 <log>
239 <log>
240 <logentry
240 <logentry
241 revision="2">
241 revision="2">
242 <author>test</author>
242 <author>test</author>
243 <date/>
243 <date/>
244 <paths>
244 <paths>
245 <path
245 <path
246 action="A">/d2</path>
246 action="A">/d2</path>
247 <path
247 <path
248 copyfrom-path="/d1/a"
248 copyfrom-path="/d1/a"
249 copyfrom-rev="1"
249 copyfrom-rev="1"
250 action="A">/d2/a</path>
250 action="A">/d2/a</path>
251 </paths>
251 </paths>
252 <msg>copy file to new directory</msg>
252 <msg>copy file to new directory</msg>
253 </logentry>
253 </logentry>
254 </log>
254 </log>
255 % branchy history
255 % branchy history
256 adding b
256 adding b
257 adding left-1
257 adding left-1
258 adding left-2
258 adding left-2
259 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
259 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
260 adding right-1
260 adding right-1
261 created new head
261 created new head
262 adding right-2
262 adding right-2
263 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
263 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
264 merging b
264 merging b
265 warning: conflicts during merge.
265 warning: conflicts during merge.
266 merging b failed!
266 merging b failed!
267 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
267 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
268 use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon
268 use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon
269 assuming destination b-hg
269 assuming destination b-hg
270 initializing svn repo 'b-hg'
270 initializing svn repo 'b-hg'
271 initializing svn wc 'b-hg-wc'
271 initializing svn wc 'b-hg-wc'
272 scanning source...
272 scanning source...
273 sorting...
273 sorting...
274 converting...
274 converting...
275 5 base
275 5 base
276 4 left-1
276 4 left-1
277 3 left-2
277 3 left-2
278 2 right-1
278 2 right-1
279 1 right-2
279 1 right-2
280 0 merge
280 0 merge
281 % expect 4 changes
281 % expect 4 changes
282 At revision 4.
282 At revision 4.
283 4 4 test .
283 4 4 test .
284 4 3 test b
284 4 3 test b
285 4 2 test left-1
285 4 2 test left-1
286 4 3 test left-2
286 4 3 test left-2
287 4 4 test right-1
287 4 4 test right-1
288 4 4 test right-2
288 4 4 test right-2
289 <?xml version="1.0"?>
289 <?xml version="1.0"?>
290 <log>
290 <log>
291 <logentry
291 <logentry
292 revision="4">
292 revision="4">
293 <author>test</author>
293 <author>test</author>
294 <date/>
294 <date/>
295 <paths>
295 <paths>
296 <path
296 <path
297 action="A">/right-1</path>
297 action="A">/right-1</path>
298 <path
298 <path
299 action="A">/right-2</path>
299 action="A">/right-2</path>
300 </paths>
300 </paths>
301 <msg>merge</msg>
301 <msg>merge</msg>
302 </logentry>
302 </logentry>
303 <logentry
303 <logentry
304 revision="3">
304 revision="3">
305 <author>test</author>
305 <author>test</author>
306 <date/>
306 <date/>
307 <paths>
307 <paths>
308 <path
308 <path
309 action="M">/b</path>
309 action="M">/b</path>
310 <path
310 <path
311 action="A">/left-2</path>
311 action="A">/left-2</path>
312 </paths>
312 </paths>
313 <msg>left-2</msg>
313 <msg>left-2</msg>
314 </logentry>
314 </logentry>
315 <logentry
315 <logentry
316 revision="2">
316 revision="2">
317 <author>test</author>
317 <author>test</author>
318 <date/>
318 <date/>
319 <paths>
319 <paths>
320 <path
320 <path
321 action="M">/b</path>
321 action="M">/b</path>
322 <path
322 <path
323 action="A">/left-1</path>
323 action="A">/left-1</path>
324 </paths>
324 </paths>
325 <msg>left-1</msg>
325 <msg>left-1</msg>
326 </logentry>
326 </logentry>
327 <logentry
327 <logentry
328 revision="1">
328 revision="1">
329 <author>test</author>
329 <author>test</author>
330 <date/>
330 <date/>
331 <paths>
331 <paths>
332 <path
332 <path
333 action="A">/b</path>
333 action="A">/b</path>
334 </paths>
334 </paths>
335 <msg>base</msg>
335 <msg>base</msg>
336 </logentry>
336 </logentry>
337 </log>
337 </log>
General Comments 0
You need to be logged in to leave comments. Login now