Show More
@@ -1,210 +1,210 | |||
|
1 | 1 | |
|
2 | 2 | $ "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
3 | 3 | |
|
4 | 4 | $ fixpath() |
|
5 | 5 | > { |
|
6 | 6 | > tr '\\' / |
|
7 | 7 | > } |
|
8 | 8 | $ cat >> $HGRCPATH <<EOF |
|
9 | 9 | > [extensions] |
|
10 | 10 | > convert = |
|
11 | 11 | > graphlog = |
|
12 | 12 | > [convert] |
|
13 | 13 | > svn.trunk = mytrunk |
|
14 | 14 | > EOF |
|
15 | 15 | |
|
16 | 16 | $ svnadmin create svn-repo |
|
17 | 17 | $ svnpath=`pwd | fixpath` |
|
18 | 18 | |
|
19 | 19 | |
|
20 | 20 | $ expr "$svnpath" : "\/" > /dev/null |
|
21 | 21 | > if [ $? -ne 0 ]; then |
|
22 | 22 | > svnpath="/$svnpath" |
|
23 | 23 | > fi |
|
24 | 24 | > svnurl="file://$svnpath/svn-repo" |
|
25 | 25 | |
|
26 | 26 | Now test that it works with trunk/tags layout, but no branches yet. |
|
27 | 27 | |
|
28 | 28 | Initial svn import |
|
29 | 29 | |
|
30 | 30 | $ mkdir projB |
|
31 | 31 | $ cd projB |
|
32 | 32 | $ mkdir mytrunk |
|
33 | 33 | $ mkdir tags |
|
34 | 34 | $ cd .. |
|
35 | 35 | |
|
36 | 36 | $ svnurl="file://$svnpath/svn-repo/proj%20B" |
|
37 | $ svn import -m "init projB" projB "$svnurl" | fixpath | |
|
37 | $ svn import -m "init projB" projB "$svnurl" | fixpath | sort | |
|
38 | ||
|
38 | 39 | Adding projB/mytrunk |
|
39 | 40 | Adding projB/tags |
|
40 | ||
|
41 | 41 | Committed revision 1. |
|
42 | 42 | |
|
43 | 43 | Update svn repository |
|
44 | 44 | |
|
45 | 45 | $ svn co "$svnurl"/mytrunk B | fixpath |
|
46 | 46 | Checked out revision 1. |
|
47 | 47 | $ cd B |
|
48 | 48 | $ echo hello > 'letter .txt' |
|
49 | 49 | $ svn add 'letter .txt' |
|
50 | 50 | A letter .txt |
|
51 | 51 | $ svn ci -m hello |
|
52 | 52 | Adding letter .txt |
|
53 | 53 | Transmitting file data . |
|
54 | 54 | Committed revision 2. |
|
55 | 55 | |
|
56 | 56 | $ "$TESTDIR/svn-safe-append.py" world 'letter .txt' |
|
57 | 57 | $ svn ci -m world |
|
58 | 58 | Sending letter .txt |
|
59 | 59 | Transmitting file data . |
|
60 | 60 | Committed revision 3. |
|
61 | 61 | |
|
62 | 62 | $ svn copy -m "tag v0.1" "$svnurl"/mytrunk "$svnurl"/tags/v0.1 |
|
63 | 63 | |
|
64 | 64 | Committed revision 4. |
|
65 | 65 | |
|
66 | 66 | $ "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt' |
|
67 | 67 | $ svn ci -m "nice day" |
|
68 | 68 | Sending letter .txt |
|
69 | 69 | Transmitting file data . |
|
70 | 70 | Committed revision 5. |
|
71 | 71 | $ cd .. |
|
72 | 72 | |
|
73 | 73 | Convert to hg once |
|
74 | 74 | |
|
75 | 75 | $ hg convert "$svnurl" B-hg |
|
76 | 76 | initializing destination B-hg repository |
|
77 | 77 | scanning source... |
|
78 | 78 | sorting... |
|
79 | 79 | converting... |
|
80 | 80 | 3 init projB |
|
81 | 81 | 2 hello |
|
82 | 82 | 1 world |
|
83 | 83 | 0 nice day |
|
84 | 84 | updating tags |
|
85 | 85 | |
|
86 | 86 | Update svn repository again |
|
87 | 87 | |
|
88 | 88 | $ cd B |
|
89 | 89 | $ "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt' |
|
90 | 90 | $ echo "nice to meet you" > letter2.txt |
|
91 | 91 | $ svn add letter2.txt |
|
92 | 92 | A letter2.txt |
|
93 | 93 | $ svn ci -m "second letter" |
|
94 | 94 | Sending letter .txt |
|
95 | 95 | Adding letter2.txt |
|
96 | 96 | Transmitting file data .. |
|
97 | 97 | Committed revision 6. |
|
98 | 98 | |
|
99 | 99 | $ svn copy -m "tag v0.2" "$svnurl"/mytrunk "$svnurl"/tags/v0.2 |
|
100 | 100 | |
|
101 | 101 | Committed revision 7. |
|
102 | 102 | |
|
103 | 103 | $ "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt |
|
104 | 104 | $ svn ci -m "work in progress" |
|
105 | 105 | Sending letter2.txt |
|
106 | 106 | Transmitting file data . |
|
107 | 107 | Committed revision 8. |
|
108 | 108 | $ cd .. |
|
109 | 109 | |
|
110 | 110 | $ hg convert -s svn "$svnurl/non-existent-path" dest |
|
111 | 111 | initializing destination dest repository |
|
112 | 112 | abort: no revision found in module /proj B/non-existent-path |
|
113 | 113 | [255] |
|
114 | 114 | |
|
115 | 115 | ######################################## |
|
116 | 116 | |
|
117 | 117 | Test incremental conversion |
|
118 | 118 | |
|
119 | 119 | $ hg convert "$svnurl" B-hg |
|
120 | 120 | scanning source... |
|
121 | 121 | sorting... |
|
122 | 122 | converting... |
|
123 | 123 | 1 second letter |
|
124 | 124 | 0 work in progress |
|
125 | 125 | updating tags |
|
126 | 126 | |
|
127 | 127 | $ cd B-hg |
|
128 | 128 | $ hg glog --template '{rev} {desc|firstline} files: {files}\n' |
|
129 | 129 | o 7 update tags files: .hgtags |
|
130 | 130 | | |
|
131 | 131 | o 6 work in progress files: letter2.txt |
|
132 | 132 | | |
|
133 | 133 | o 5 second letter files: letter .txt letter2.txt |
|
134 | 134 | | |
|
135 | 135 | o 4 update tags files: .hgtags |
|
136 | 136 | | |
|
137 | 137 | o 3 nice day files: letter .txt |
|
138 | 138 | | |
|
139 | 139 | o 2 world files: letter .txt |
|
140 | 140 | | |
|
141 | 141 | o 1 hello files: letter .txt |
|
142 | 142 | | |
|
143 | 143 | o 0 init projB files: |
|
144 | 144 | |
|
145 | 145 | $ hg tags -q |
|
146 | 146 | tip |
|
147 | 147 | v0.2 |
|
148 | 148 | v0.1 |
|
149 | 149 | $ cd .. |
|
150 | 150 | |
|
151 | 151 | Test filemap |
|
152 | 152 | $ echo 'include letter2.txt' > filemap |
|
153 | 153 | $ hg convert --filemap filemap "$svnurl"/mytrunk fmap |
|
154 | 154 | initializing destination fmap repository |
|
155 | 155 | scanning source... |
|
156 | 156 | sorting... |
|
157 | 157 | converting... |
|
158 | 158 | 5 init projB |
|
159 | 159 | 4 hello |
|
160 | 160 | 3 world |
|
161 | 161 | 2 nice day |
|
162 | 162 | 1 second letter |
|
163 | 163 | 0 work in progress |
|
164 | 164 | $ hg -R fmap branch -q |
|
165 | 165 | default |
|
166 | 166 | $ hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n' |
|
167 | 167 | o 1 work in progress files: letter2.txt |
|
168 | 168 | | |
|
169 | 169 | o 0 second letter files: letter2.txt |
|
170 | 170 | |
|
171 | 171 | |
|
172 | 172 | Test stop revision |
|
173 | 173 | $ hg convert --rev 1 "$svnurl"/mytrunk stoprev |
|
174 | 174 | initializing destination stoprev repository |
|
175 | 175 | scanning source... |
|
176 | 176 | sorting... |
|
177 | 177 | converting... |
|
178 | 178 | 0 init projB |
|
179 | 179 | $ hg -R stoprev branch -q |
|
180 | 180 | default |
|
181 | 181 | |
|
182 | 182 | Check convert_revision extra-records. |
|
183 | 183 | This is also the only place testing more than one extra field in a revision. |
|
184 | 184 | |
|
185 | 185 | $ cd stoprev |
|
186 | 186 | $ hg tip --debug | grep extra |
|
187 | 187 | extra: branch=default |
|
188 | 188 | extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) |
|
189 | 189 | $ cd .. |
|
190 | 190 | |
|
191 | 191 | Test converting empty heads (issue3347) |
|
192 | 192 | |
|
193 | 193 | $ svnadmin create svn-empty |
|
194 | 194 | $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump" |
|
195 | 195 | $ hg --config convert.svn.trunk= convert svn-empty |
|
196 | 196 | assuming destination svn-empty-hg |
|
197 | 197 | initializing destination svn-empty-hg repository |
|
198 | 198 | scanning source... |
|
199 | 199 | sorting... |
|
200 | 200 | converting... |
|
201 | 201 | 1 init projA |
|
202 | 202 | 0 adddir |
|
203 | 203 | $ hg --config convert.svn.trunk= convert file://$svnpath/svn-empty/trunk |
|
204 | 204 | assuming destination trunk-hg |
|
205 | 205 | initializing destination trunk-hg repository |
|
206 | 206 | scanning source... |
|
207 | 207 | sorting... |
|
208 | 208 | converting... |
|
209 | 209 | 1 init projA |
|
210 | 210 | 0 adddir |
General Comments 0
You need to be logged in to leave comments.
Login now