Debian Codegraph @

tests/test-convert-svn-encoding.t

raw
1 #require svn svn-bindings
2
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
5 > convert =
6 > EOF
7
8 $ svnadmin create svn-repo
9 $ svnadmin load -q svn-repo < "$TESTDIR/svn/encoding.svndump"
10
11 Convert while testing all possible outputs
12
13 $ hg --debug convert svn-repo A-hg --config progress.debug=1
14 initializing destination A-hg repository
15 reparent to file:/*/$TESTTMP/svn-repo (glob)
16 run hg sink pre-conversion action
17 scanning source...
18 found trunk at 'trunk'
19 found tags at 'tags'
20 found branches at 'branches'
21 found branch branch\xc3\xa9 at 5 (esc)
22 found branch branch\xc3\xa9e at 6 (esc)
23 scanning: 1/4 revisions (25.00%)
24 reparent to file:/*/$TESTTMP/svn-repo/trunk (glob)
25 fetching revision log for "/trunk" from 4 to 0
26 parsing revision 4 (2 changes)
27 parsing revision 3 (4 changes)
28 parsing revision 2 (3 changes)
29 parsing revision 1 (3 changes)
30 no copyfrom path, don't know what to do.
31 '/branches' is not under '/trunk', ignoring
32 '/tags' is not under '/trunk', ignoring
33 scanning: 2/4 revisions (50.00%)
34 reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9 (glob)
35 fetching revision log for "/branches/branch\xc3\xa9" from 5 to 0 (esc)
36 parsing revision 5 (1 changes)
37 reparent to file:/*/$TESTTMP/svn-repo (glob)
38 reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9 (glob)
39 found parent of branch /branches/branch\xc3\xa9 at 4: /trunk (esc)
40 scanning: 3/4 revisions (75.00%)
41 reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob)
42 fetching revision log for "/branches/branch\xc3\xa9e" from 6 to 0 (esc)
43 parsing revision 6 (1 changes)
44 reparent to file:/*/$TESTTMP/svn-repo (glob)
45 reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob)
46 found parent of branch /branches/branch\xc3\xa9e at 5: /branches/branch\xc3\xa9 (esc)
47 scanning: 4/4 revisions (100.00%)
48 scanning: 5/4 revisions (125.00%)
49 scanning: 6/4 revisions (150.00%)
50 sorting...
51 converting...
52 5 init projA
53 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@1
54 converting: 0/6 revisions (0.00%)
55 reusing manifest from p1 (no file change)
56 committing changelog
57 updating the branch cache
58 4 hello
59 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@2
60 converting: 1/6 revisions (16.67%)
61 reparent to file:/*/$TESTTMP/svn-repo/trunk (glob)
62 scanning paths: /trunk/\xc3\xa0 0/3 paths (0.00%) (esc)
63 scanning paths: /trunk/\xc3\xa0/e\xcc\x81 1/3 paths (33.33%) (esc)
64 scanning paths: /trunk/\xc3\xa9 2/3 paths (66.67%) (esc)
65 committing files:
66 \xc3\xa0/e\xcc\x81 (esc)
67 getting files: \xc3\xa0/e\xcc\x81 1/2 files (50.00%) (esc)
68 \xc3\xa9 (esc)
69 getting files: \xc3\xa9 2/2 files (100.00%) (esc)
70 committing manifest
71 committing changelog
72 updating the branch cache
73 3 copy files
74 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@3
75 converting: 2/6 revisions (33.33%)
76 scanning paths: /trunk/\xc3\xa0 0/4 paths (0.00%) (esc)
77 gone from -1
78 reparent to file:/*/$TESTTMP/svn-repo (glob)
79 reparent to file:/*/$TESTTMP/svn-repo/trunk (glob)
80 scanning paths: /trunk/\xc3\xa8 1/4 paths (25.00%) (esc)
81 copied to \xc3\xa8 from \xc3\xa9@2 (esc)
82 scanning paths: /trunk/\xc3\xa9 2/4 paths (50.00%) (esc)
83 gone from -1
84 reparent to file:/*/$TESTTMP/svn-repo (glob)
85 reparent to file:/*/$TESTTMP/svn-repo/trunk (glob)
86 scanning paths: /trunk/\xc3\xb9 3/4 paths (75.00%) (esc)
87 mark /trunk/\xc3\xb9 came from \xc3\xa0:2 (esc)
88 getting files: \xc3\xa0/e\xcc\x81 1/4 files (25.00%) (esc)
89 getting files: \xc3\xa9 2/4 files (50.00%) (esc)
90 committing files:
91 \xc3\xa8 (esc)
92 getting files: \xc3\xa8 3/4 files (75.00%) (esc)
93 \xc3\xa8: copy \xc3\xa9:6b67ccefd5ce6de77e7ead4f5292843a0255329f (esc)
94 \xc3\xb9/e\xcc\x81 (esc)
95 getting files: \xc3\xb9/e\xcc\x81 4/4 files (100.00%) (esc)
96 \xc3\xb9/e\xcc\x81: copy \xc3\xa0/e\xcc\x81:a9092a3d84a37b9993b5c73576f6de29b7ea50f6 (esc)
97 committing manifest
98 committing changelog
99 updating the branch cache
100 2 remove files
101 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@4
102 converting: 3/6 revisions (50.00%)
103 scanning paths: /trunk/\xc3\xa8 0/2 paths (0.00%) (esc)
104 gone from -1
105 reparent to file:/*/$TESTTMP/svn-repo (glob)
106 reparent to file:/*/$TESTTMP/svn-repo/trunk (glob)
107 scanning paths: /trunk/\xc3\xb9 1/2 paths (50.00%) (esc)
108 gone from -1
109 reparent to file:/*/$TESTTMP/svn-repo (glob)
110 reparent to file:/*/$TESTTMP/svn-repo/trunk (glob)
111 getting files: \xc3\xa8 1/2 files (50.00%) (esc)
112 getting files: \xc3\xb9/e\xcc\x81 2/2 files (100.00%) (esc)
113 committing files:
114 committing manifest
115 committing changelog
116 updating the branch cache
117 1 branch to branch?
118 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?@5
119 converting: 4/6 revisions (66.67%)
120 reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9 (glob)
121 scanning paths: /branches/branch\xc3\xa9 0/1 paths (0.00%) (esc)
122 reusing manifest from p1 (no file change)
123 committing changelog
124 updating the branch cache
125 0 branch to branch?e
126 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?e@6
127 converting: 5/6 revisions (83.33%)
128 reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob)
129 scanning paths: /branches/branch\xc3\xa9e 0/1 paths (0.00%) (esc)
130 reusing manifest from p1 (no file change)
131 committing changelog
132 updating the branch cache
133 reparent to file:/*/$TESTTMP/svn-repo (glob)
134 reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob)
135 reparent to file:/*/$TESTTMP/svn-repo (glob)
136 reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob)
137 updating tags
138 committing files:
139 .hgtags
140 committing manifest
141 committing changelog
142 updating the branch cache
143 run hg sink post-conversion action
144 $ cd A-hg
145 $ hg up
146 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
147
148 Check tags are in UTF-8
149
150 $ cat .hgtags
151 e94e4422020e715add80525e8f0f46c9968689f1 branch\xc3\xa9e (esc)
152 f7e66f98380ed1e53a797c5c7a7a2616a7ab377d branch\xc3\xa9 (esc)
153
154 $ cd ..
155
156 Subversion sources don't support non-ASCII characters in HTTP(S) URLs.
157
158 $ XFF=$("$PYTHON" -c 'from mercurial.utils.procutil import stdout; stdout.write(b"\xff")')
159 $ hg convert --source-type=svn http://localhost:$HGPORT/$XFF test
160 initializing destination test repository
161 Subversion sources don't support non-ASCII characters in HTTP(S) URLs. Please percent-encode them.
162 http://localhost:$HGPORT/\xff does not look like a Subversion repository (esc)
163 abort: http://localhost:$HGPORT/\xff: missing or unsupported repository (esc)
164 [255]
165
166 In Subversion, paths are Unicode (encoded as UTF-8). Therefore paths that can't
167 be converted between UTF-8 and the locale encoding (which is always ASCII in
168 tests) don't work.
169
170 $ cp -R svn-repo $XFF
171 $ hg convert $XFF test
172 initializing destination test repository
173 Subversion requires that paths can be converted to Unicode using the current locale encoding (ascii)
174 \xff does not look like a CVS checkout (glob) (esc)
175 $TESTTMP/\xff does not look like a Git repository (esc)
176 \xff does not look like a Subversion repository (glob) (esc)
177 \xff is not a local Mercurial repository (glob) (esc)
178 \xff does not look like a darcs repository (glob) (esc)
179 \xff does not look like a monotone repository (glob) (esc)
180 \xff does not look like a GNU Arch repository (glob) (esc)
181 \xff does not look like a Bazaar repository (glob) (esc)
182 cannot find required "p4" tool
183 abort: \xff: missing or unsupported repository (glob) (esc)
184 [255]
185 $ hg convert file://$TESTTMP/$XFF test
186 initializing destination test repository
187 Subversion requires that file URLs can be converted to Unicode using the current locale encoding (ascii)
188 file:/*/$TESTTMP/\xff does not look like a CVS checkout (glob) (esc)
189 $TESTTMP/file:$TESTTMP/\xff does not look like a Git repository (esc)
190 file:/*/$TESTTMP/\xff does not look like a Subversion repository (glob) (esc)
191 file:/*/$TESTTMP/\xff is not a local Mercurial repository (glob) (esc)
192 file:/*/$TESTTMP/\xff does not look like a darcs repository (glob) (esc)
193 file:/*/$TESTTMP/\xff does not look like a monotone repository (glob) (esc)
194 file:/*/$TESTTMP/\xff does not look like a GNU Arch repository (glob) (esc)
195 file:/*/$TESTTMP/\xff does not look like a Bazaar repository (glob) (esc)
196 file:/*/$TESTTMP/\xff does not look like a P4 repository (glob) (esc)
197 abort: file:/*/$TESTTMP/\xff: missing or unsupported repository (glob) (esc)
198 [255]
199
200 Subversion decodes percent-encoded bytes on the converted, UTF-8-encoded
201 string. Therefore, if the percent-encoded bytes aren't valid UTF-8, Subversion
202 would choke on them when converting them to the locale encoding.
203
204 $ hg convert file://$TESTTMP/%FF test
205 initializing destination test repository
206 Subversion does not support non-UTF-8 percent-encoded bytes in file URLs
207 file:/*/$TESTTMP/%FF does not look like a CVS checkout (glob)
208 $TESTTMP/file:$TESTTMP/%FF does not look like a Git repository
209 file:/*/$TESTTMP/%FF does not look like a Subversion repository (glob)
210 file:/*/$TESTTMP/%FF is not a local Mercurial repository (glob)
211 file:/*/$TESTTMP/%FF does not look like a darcs repository (glob)
212 file:/*/$TESTTMP/%FF does not look like a monotone repository (glob)
213 file:/*/$TESTTMP/%FF does not look like a GNU Arch repository (glob)
214 file:/*/$TESTTMP/%FF does not look like a Bazaar repository (glob)
215 file:/*/$TESTTMP/%FF does not look like a P4 repository (glob)
216 abort: file:/*/$TESTTMP/%FF: missing or unsupported repository (glob)
217 [255]