Show More
@@ -0,0 +1,51 b'' | |||||
|
1 | # Read the output of a "svn log --xml" command on stdin, parse it and | |||
|
2 | # print a subset of attributes common to all svn versions tested by | |||
|
3 | # hg. | |||
|
4 | import xml.dom.minidom, sys | |||
|
5 | ||||
|
6 | def xmltext(e): | |||
|
7 | return ''.join(c.data for c | |||
|
8 | in e.childNodes | |||
|
9 | if c.nodeType == c.TEXT_NODE) | |||
|
10 | ||||
|
11 | def parseentry(entry): | |||
|
12 | e = {} | |||
|
13 | e['revision'] = entry.getAttribute('revision') | |||
|
14 | e['author'] = xmltext(entry.getElementsByTagName('author')[0]) | |||
|
15 | e['msg'] = xmltext(entry.getElementsByTagName('msg')[0]) | |||
|
16 | e['paths'] = [] | |||
|
17 | paths = entry.getElementsByTagName('paths') | |||
|
18 | if paths: | |||
|
19 | paths = paths[0] | |||
|
20 | for p in paths.getElementsByTagName('path'): | |||
|
21 | action = p.getAttribute('action') | |||
|
22 | path = xmltext(p) | |||
|
23 | frompath = p.getAttribute('copyfrom-path') | |||
|
24 | fromrev = p.getAttribute('copyfrom-rev') | |||
|
25 | e['paths'].append((path, action, frompath, fromrev)) | |||
|
26 | return e | |||
|
27 | ||||
|
28 | def parselog(data): | |||
|
29 | entries = [] | |||
|
30 | doc = xml.dom.minidom.parseString(data) | |||
|
31 | for e in doc.getElementsByTagName('logentry'): | |||
|
32 | entries.append(parseentry(e)) | |||
|
33 | return entries | |||
|
34 | ||||
|
35 | def printentries(entries): | |||
|
36 | fp = sys.stdout | |||
|
37 | for e in entries: | |||
|
38 | for k in ('revision', 'author', 'msg'): | |||
|
39 | fp.write(('%s: %s\n' % (k, e[k])).encode('utf-8')) | |||
|
40 | for path, action, fpath, frev in sorted(e['paths']): | |||
|
41 | frominfo = '' | |||
|
42 | if frev: | |||
|
43 | frominfo = ' (from %s@%s)' % (fpath, frev) | |||
|
44 | p = ' %s %s%s\n' % (action, path, frominfo) | |||
|
45 | fp.write(p.encode('utf-8')) | |||
|
46 | ||||
|
47 | if __name__ == '__main__': | |||
|
48 | data = sys.stdin.read() | |||
|
49 | entries = parselog(data) | |||
|
50 | printentries(entries) | |||
|
51 |
@@ -1,548 +1,405 b'' | |||||
1 | $ "$TESTDIR/hghave" svn13 no-outer-repo symlink execbit || exit 80 |
|
1 | $ "$TESTDIR/hghave" svn13 no-outer-repo symlink execbit || exit 80 | |
2 |
|
2 | |||
3 | $ fixpath() |
|
3 | $ fixpath() | |
4 | > { |
|
4 | > { | |
5 | > tr '\\' / |
|
5 | > tr '\\' / | |
6 | > } |
|
6 | > } | |
7 | $ svnupanddisplay() |
|
7 | $ svnupanddisplay() | |
8 | > { |
|
8 | > { | |
9 | > ( |
|
9 | > ( | |
10 | > cd $1; |
|
10 | > cd $1; | |
11 | > svn up; |
|
11 | > svn up -q; | |
12 | > svn st -v | fixpath | sed 's/ */ /g' |
|
12 | > svn st -v | fixpath | sed 's/ */ /g' | sort | |
13 | > limit='' |
|
13 | > limit='' | |
14 | > if [ $2 -gt 0 ]; then |
|
14 | > if [ $2 -gt 0 ]; then | |
15 | > limit="--limit=$2" |
|
15 | > limit="--limit=$2" | |
16 | > fi |
|
16 | > fi | |
17 |
> svn log --xml -v $limit |
|
17 | > svn log --xml -v $limit | python "$TESTDIR/svnxml.py" | |
18 | > | fixpath \ |
|
|||
19 | > | sed 's,<date>.*,<date/>,' \ |
|
|||
20 | > | grep -v 'kind="' |
|
|||
21 | > ) |
|
18 | > ) | |
22 | > } |
|
19 | > } | |
23 |
|
20 | |||
24 | $ cat >> $HGRCPATH <<EOF |
|
21 | $ cat >> $HGRCPATH <<EOF | |
25 | > [extensions] |
|
22 | > [extensions] | |
26 | > convert = |
|
23 | > convert = | |
27 | > graphlog = |
|
24 | > graphlog = | |
28 | > EOF |
|
25 | > EOF | |
29 |
|
26 | |||
30 | $ hg init a |
|
27 | $ hg init a | |
31 |
|
28 | |||
32 | Add |
|
29 | Add | |
33 |
|
30 | |||
34 | $ echo a > a/a |
|
31 | $ echo a > a/a | |
35 | $ mkdir -p a/d1/d2 |
|
32 | $ mkdir -p a/d1/d2 | |
36 | $ echo b > a/d1/d2/b |
|
33 | $ echo b > a/d1/d2/b | |
37 | $ ln -s a/missing a/link |
|
34 | $ ln -s a/missing a/link | |
38 | $ hg --cwd a ci -d '0 0' -A -m 'add a file' |
|
35 | $ hg --cwd a ci -d '0 0' -A -m 'add a file' | |
39 | adding a |
|
36 | adding a | |
40 | adding d1/d2/b |
|
37 | adding d1/d2/b | |
41 | adding link |
|
38 | adding link | |
42 |
|
39 | |||
43 | Modify |
|
40 | Modify | |
44 |
|
41 | |||
45 | $ "$TESTDIR/svn-safe-append.py" a a/a |
|
42 | $ "$TESTDIR/svn-safe-append.py" a a/a | |
46 | $ hg --cwd a ci -d '1 0' -m 'modify a file' |
|
43 | $ hg --cwd a ci -d '1 0' -m 'modify a file' | |
47 | $ hg --cwd a tip -q |
|
44 | $ hg --cwd a tip -q | |
48 | 1:8231f652da37 |
|
45 | 1:8231f652da37 | |
49 |
|
46 | |||
50 | $ hg convert -d svn a |
|
47 | $ hg convert -d svn a | |
51 | assuming destination a-hg |
|
48 | assuming destination a-hg | |
52 | initializing svn repository 'a-hg' |
|
49 | initializing svn repository 'a-hg' | |
53 | initializing svn working copy 'a-hg-wc' |
|
50 | initializing svn working copy 'a-hg-wc' | |
54 | scanning source... |
|
51 | scanning source... | |
55 | sorting... |
|
52 | sorting... | |
56 | converting... |
|
53 | converting... | |
57 | 1 add a file |
|
54 | 1 add a file | |
58 | 0 modify a file |
|
55 | 0 modify a file | |
59 | $ svnupanddisplay a-hg-wc 2 |
|
56 | $ svnupanddisplay a-hg-wc 2 | |
60 | At revision 2. |
|
|||
61 | 2 2 test . |
|
|||
62 | 2 2 test a |
|
|||
63 | 2 1 test d1 |
|
57 | 2 1 test d1 | |
64 | 2 1 test d1/d2 |
|
58 | 2 1 test d1/d2 | |
65 | 2 1 test d1/d2/b |
|
59 | 2 1 test d1/d2/b | |
66 | 2 1 test link |
|
60 | 2 1 test link | |
67 | <?xml version="1.0"?> |
|
61 | 2 2 test . | |
68 | <log> |
|
62 | 2 2 test a | |
69 | <logentry |
|
63 | revision: 2 | |
70 | revision="2"> |
|
64 | author: test | |
71 | <author>test</author> |
|
65 | msg: modify a file | |
72 | <date/> |
|
66 | M /a | |
73 | <paths> |
|
67 | revision: 1 | |
74 | <path |
|
68 | author: test | |
75 | action="M">/a</path> |
|
69 | msg: add a file | |
76 | </paths> |
|
70 | A /a | |
77 | <msg>modify a file</msg> |
|
71 | A /d1 | |
78 | </logentry> |
|
72 | A /d1/d2 | |
79 | <logentry |
|
73 | A /d1/d2/b | |
80 | revision="1"> |
|
74 | A /link | |
81 | <author>test</author> |
|
|||
82 | <date/> |
|
|||
83 | <paths> |
|
|||
84 | <path |
|
|||
85 | action="A">/a</path> |
|
|||
86 | <path |
|
|||
87 | action="A">/d1</path> |
|
|||
88 | <path |
|
|||
89 | action="A">/d1/d2</path> |
|
|||
90 | <path |
|
|||
91 | action="A">/d1/d2/b</path> |
|
|||
92 | <path |
|
|||
93 | action="A">/link</path> |
|
|||
94 | </paths> |
|
|||
95 | <msg>add a file</msg> |
|
|||
96 | </logentry> |
|
|||
97 | </log> |
|
|||
98 | $ ls a a-hg-wc |
|
75 | $ ls a a-hg-wc | |
99 | a: |
|
76 | a: | |
100 | a |
|
77 | a | |
101 | d1 |
|
78 | d1 | |
102 | link |
|
79 | link | |
103 |
|
80 | |||
104 | a-hg-wc: |
|
81 | a-hg-wc: | |
105 | a |
|
82 | a | |
106 | d1 |
|
83 | d1 | |
107 | link |
|
84 | link | |
108 | $ cmp a/a a-hg-wc/a |
|
85 | $ cmp a/a a-hg-wc/a | |
109 |
|
86 | |||
110 | Rename |
|
87 | Rename | |
111 |
|
88 | |||
112 | $ hg --cwd a mv a b |
|
89 | $ hg --cwd a mv a b | |
113 | $ hg --cwd a mv link newlink |
|
90 | $ hg --cwd a mv link newlink | |
114 |
|
91 | |||
115 | $ hg --cwd a ci -d '2 0' -m 'rename a file' |
|
92 | $ hg --cwd a ci -d '2 0' -m 'rename a file' | |
116 | $ hg --cwd a tip -q |
|
93 | $ hg --cwd a tip -q | |
117 | 2:a67e26ccec09 |
|
94 | 2:a67e26ccec09 | |
118 |
|
95 | |||
119 | $ hg convert -d svn a |
|
96 | $ hg convert -d svn a | |
120 | assuming destination a-hg |
|
97 | assuming destination a-hg | |
121 | initializing svn working copy 'a-hg-wc' |
|
98 | initializing svn working copy 'a-hg-wc' | |
122 | scanning source... |
|
99 | scanning source... | |
123 | sorting... |
|
100 | sorting... | |
124 | converting... |
|
101 | converting... | |
125 | 0 rename a file |
|
102 | 0 rename a file | |
126 | $ svnupanddisplay a-hg-wc 1 |
|
103 | $ svnupanddisplay a-hg-wc 1 | |
127 | At revision 3. |
|
|||
128 | 3 3 test . |
|
|||
129 | 3 3 test b |
|
|||
130 | 3 1 test d1 |
|
104 | 3 1 test d1 | |
131 | 3 1 test d1/d2 |
|
105 | 3 1 test d1/d2 | |
132 | 3 1 test d1/d2/b |
|
106 | 3 1 test d1/d2/b | |
|
107 | 3 3 test . | |||
|
108 | 3 3 test b | |||
133 | 3 3 test newlink |
|
109 | 3 3 test newlink | |
134 | <?xml version="1.0"?> |
|
110 | revision: 3 | |
135 | <log> |
|
111 | author: test | |
136 | <logentry |
|
112 | msg: rename a file | |
137 | revision="3"> |
|
113 | D /a | |
138 | <author>test</author> |
|
114 | A /b (from /a@2) | |
139 | <date/> |
|
115 | D /link | |
140 | <paths> |
|
116 | A /newlink (from /link@2) | |
141 | <path |
|
|||
142 | action="D">/a</path> |
|
|||
143 | <path |
|
|||
144 | copyfrom-path="/a" |
|
|||
145 | copyfrom-rev="2" |
|
|||
146 | action="A">/b</path> |
|
|||
147 | <path |
|
|||
148 | copyfrom-path="/link" |
|
|||
149 | copyfrom-rev="2" |
|
|||
150 | action="A">/newlink</path> |
|
|||
151 | <path |
|
|||
152 | action="D">/link</path> |
|
|||
153 | </paths> |
|
|||
154 | <msg>rename a file</msg> |
|
|||
155 | </logentry> |
|
|||
156 | </log> |
|
|||
157 | $ ls a a-hg-wc |
|
117 | $ ls a a-hg-wc | |
158 | a: |
|
118 | a: | |
159 | b |
|
119 | b | |
160 | d1 |
|
120 | d1 | |
161 | newlink |
|
121 | newlink | |
162 |
|
122 | |||
163 | a-hg-wc: |
|
123 | a-hg-wc: | |
164 | b |
|
124 | b | |
165 | d1 |
|
125 | d1 | |
166 | newlink |
|
126 | newlink | |
167 |
|
127 | |||
168 | Copy |
|
128 | Copy | |
169 |
|
129 | |||
170 | $ hg --cwd a cp b c |
|
130 | $ hg --cwd a cp b c | |
171 |
|
131 | |||
172 | $ hg --cwd a ci -d '3 0' -m 'copy a file' |
|
132 | $ hg --cwd a ci -d '3 0' -m 'copy a file' | |
173 | $ hg --cwd a tip -q |
|
133 | $ hg --cwd a tip -q | |
174 | 3:0cf087b9ab02 |
|
134 | 3:0cf087b9ab02 | |
175 |
|
135 | |||
176 | $ hg convert -d svn a |
|
136 | $ hg convert -d svn a | |
177 | assuming destination a-hg |
|
137 | assuming destination a-hg | |
178 | initializing svn working copy 'a-hg-wc' |
|
138 | initializing svn working copy 'a-hg-wc' | |
179 | scanning source... |
|
139 | scanning source... | |
180 | sorting... |
|
140 | sorting... | |
181 | converting... |
|
141 | converting... | |
182 | 0 copy a file |
|
142 | 0 copy a file | |
183 | $ svnupanddisplay a-hg-wc 1 |
|
143 | $ svnupanddisplay a-hg-wc 1 | |
184 | At revision 4. |
|
|||
185 | 4 4 test . |
|
|||
186 | 4 3 test b |
|
|||
187 | 4 4 test c |
|
|||
188 | 4 1 test d1 |
|
144 | 4 1 test d1 | |
189 | 4 1 test d1/d2 |
|
145 | 4 1 test d1/d2 | |
190 | 4 1 test d1/d2/b |
|
146 | 4 1 test d1/d2/b | |
|
147 | 4 3 test b | |||
191 | 4 3 test newlink |
|
148 | 4 3 test newlink | |
192 | <?xml version="1.0"?> |
|
149 | 4 4 test . | |
193 | <log> |
|
150 | 4 4 test c | |
194 | <logentry |
|
151 | revision: 4 | |
195 | revision="4"> |
|
152 | author: test | |
196 | <author>test</author> |
|
153 | msg: copy a file | |
197 | <date/> |
|
154 | A /c (from /b@3) | |
198 | <paths> |
|
|||
199 | <path |
|
|||
200 | copyfrom-path="/b" |
|
|||
201 | copyfrom-rev="3" |
|
|||
202 | action="A">/c</path> |
|
|||
203 | </paths> |
|
|||
204 | <msg>copy a file</msg> |
|
|||
205 | </logentry> |
|
|||
206 | </log> |
|
|||
207 | $ ls a a-hg-wc |
|
155 | $ ls a a-hg-wc | |
208 | a: |
|
156 | a: | |
209 | b |
|
157 | b | |
210 | c |
|
158 | c | |
211 | d1 |
|
159 | d1 | |
212 | newlink |
|
160 | newlink | |
213 |
|
161 | |||
214 | a-hg-wc: |
|
162 | a-hg-wc: | |
215 | b |
|
163 | b | |
216 | c |
|
164 | c | |
217 | d1 |
|
165 | d1 | |
218 | newlink |
|
166 | newlink | |
219 |
|
167 | |||
220 | $ hg --cwd a rm b |
|
168 | $ hg --cwd a rm b | |
221 |
|
169 | |||
222 | Remove |
|
170 | Remove | |
223 |
|
171 | |||
224 | $ hg --cwd a ci -d '4 0' -m 'remove a file' |
|
172 | $ hg --cwd a ci -d '4 0' -m 'remove a file' | |
225 | $ hg --cwd a tip -q |
|
173 | $ hg --cwd a tip -q | |
226 | 4:07b2e34a5b17 |
|
174 | 4:07b2e34a5b17 | |
227 |
|
175 | |||
228 | $ hg convert -d svn a |
|
176 | $ hg convert -d svn a | |
229 | assuming destination a-hg |
|
177 | assuming destination a-hg | |
230 | initializing svn working copy 'a-hg-wc' |
|
178 | initializing svn working copy 'a-hg-wc' | |
231 | scanning source... |
|
179 | scanning source... | |
232 | sorting... |
|
180 | sorting... | |
233 | converting... |
|
181 | converting... | |
234 | 0 remove a file |
|
182 | 0 remove a file | |
235 | $ svnupanddisplay a-hg-wc 1 |
|
183 | $ svnupanddisplay a-hg-wc 1 | |
236 | At revision 5. |
|
|||
237 | 5 5 test . |
|
|||
238 | 5 4 test c |
|
|||
239 | 5 1 test d1 |
|
184 | 5 1 test d1 | |
240 | 5 1 test d1/d2 |
|
185 | 5 1 test d1/d2 | |
241 | 5 1 test d1/d2/b |
|
186 | 5 1 test d1/d2/b | |
242 | 5 3 test newlink |
|
187 | 5 3 test newlink | |
243 | <?xml version="1.0"?> |
|
188 | 5 4 test c | |
244 | <log> |
|
189 | 5 5 test . | |
245 | <logentry |
|
190 | revision: 5 | |
246 | revision="5"> |
|
191 | author: test | |
247 | <author>test</author> |
|
192 | msg: remove a file | |
248 | <date/> |
|
193 | D /b | |
249 | <paths> |
|
|||
250 | <path |
|
|||
251 | action="D">/b</path> |
|
|||
252 | </paths> |
|
|||
253 | <msg>remove a file</msg> |
|
|||
254 | </logentry> |
|
|||
255 | </log> |
|
|||
256 | $ ls a a-hg-wc |
|
194 | $ ls a a-hg-wc | |
257 | a: |
|
195 | a: | |
258 | c |
|
196 | c | |
259 | d1 |
|
197 | d1 | |
260 | newlink |
|
198 | newlink | |
261 |
|
199 | |||
262 | a-hg-wc: |
|
200 | a-hg-wc: | |
263 | c |
|
201 | c | |
264 | d1 |
|
202 | d1 | |
265 | newlink |
|
203 | newlink | |
266 |
|
204 | |||
267 | Exectutable |
|
205 | Exectutable | |
268 |
|
206 | |||
269 | $ chmod +x a/c |
|
207 | $ chmod +x a/c | |
270 | $ hg --cwd a ci -d '5 0' -m 'make a file executable' |
|
208 | $ hg --cwd a ci -d '5 0' -m 'make a file executable' | |
271 | $ hg --cwd a tip -q |
|
209 | $ hg --cwd a tip -q | |
272 | 5:31093672760b |
|
210 | 5:31093672760b | |
273 |
|
211 | |||
274 | $ hg convert -d svn a |
|
212 | $ hg convert -d svn a | |
275 | assuming destination a-hg |
|
213 | assuming destination a-hg | |
276 | initializing svn working copy 'a-hg-wc' |
|
214 | initializing svn working copy 'a-hg-wc' | |
277 | scanning source... |
|
215 | scanning source... | |
278 | sorting... |
|
216 | sorting... | |
279 | converting... |
|
217 | converting... | |
280 | 0 make a file executable |
|
218 | 0 make a file executable | |
281 | $ svnupanddisplay a-hg-wc 1 |
|
219 | $ svnupanddisplay a-hg-wc 1 | |
282 | At revision 6. |
|
|||
283 | 6 6 test . |
|
|||
284 | 6 6 test c |
|
|||
285 | 6 1 test d1 |
|
220 | 6 1 test d1 | |
286 | 6 1 test d1/d2 |
|
221 | 6 1 test d1/d2 | |
287 | 6 1 test d1/d2/b |
|
222 | 6 1 test d1/d2/b | |
288 | 6 3 test newlink |
|
223 | 6 3 test newlink | |
289 | <?xml version="1.0"?> |
|
224 | 6 6 test . | |
290 | <log> |
|
225 | 6 6 test c | |
291 | <logentry |
|
226 | revision: 6 | |
292 | revision="6"> |
|
227 | author: test | |
293 | <author>test</author> |
|
228 | msg: make a file executable | |
294 | <date/> |
|
229 | M /c | |
295 | <paths> |
|
|||
296 | <path |
|
|||
297 | action="M">/c</path> |
|
|||
298 | </paths> |
|
|||
299 | <msg>make a file executable</msg> |
|
|||
300 | </logentry> |
|
|||
301 | </log> |
|
|||
302 | $ test -x a-hg-wc/c |
|
230 | $ test -x a-hg-wc/c | |
303 |
|
231 | |||
304 | Executable in new directory |
|
232 | Executable in new directory | |
305 |
|
233 | |||
306 | $ rm -rf a a-hg a-hg-wc |
|
234 | $ rm -rf a a-hg a-hg-wc | |
307 | $ hg init a |
|
235 | $ hg init a | |
308 |
|
236 | |||
309 | $ mkdir a/d1 |
|
237 | $ mkdir a/d1 | |
310 | $ echo a > a/d1/a |
|
238 | $ echo a > a/d1/a | |
311 | $ chmod +x a/d1/a |
|
239 | $ chmod +x a/d1/a | |
312 | $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory' |
|
240 | $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory' | |
313 | adding d1/a |
|
241 | adding d1/a | |
314 |
|
242 | |||
315 | $ hg convert -d svn a |
|
243 | $ hg convert -d svn a | |
316 | assuming destination a-hg |
|
244 | assuming destination a-hg | |
317 | initializing svn repository 'a-hg' |
|
245 | initializing svn repository 'a-hg' | |
318 | initializing svn working copy 'a-hg-wc' |
|
246 | initializing svn working copy 'a-hg-wc' | |
319 | scanning source... |
|
247 | scanning source... | |
320 | sorting... |
|
248 | sorting... | |
321 | converting... |
|
249 | converting... | |
322 | 0 add executable file in new directory |
|
250 | 0 add executable file in new directory | |
323 | $ svnupanddisplay a-hg-wc 1 |
|
251 | $ svnupanddisplay a-hg-wc 1 | |
324 | At revision 1. |
|
|||
325 | 1 1 test . |
|
252 | 1 1 test . | |
326 | 1 1 test d1 |
|
253 | 1 1 test d1 | |
327 | 1 1 test d1/a |
|
254 | 1 1 test d1/a | |
328 | <?xml version="1.0"?> |
|
255 | revision: 1 | |
329 | <log> |
|
256 | author: test | |
330 | <logentry |
|
257 | msg: add executable file in new directory | |
331 | revision="1"> |
|
258 | A /d1 | |
332 | <author>test</author> |
|
259 | A /d1/a | |
333 | <date/> |
|
|||
334 | <paths> |
|
|||
335 | <path |
|
|||
336 | action="A">/d1</path> |
|
|||
337 | <path |
|
|||
338 | action="A">/d1/a</path> |
|
|||
339 | </paths> |
|
|||
340 | <msg>add executable file in new directory</msg> |
|
|||
341 | </logentry> |
|
|||
342 | </log> |
|
|||
343 | $ test -x a-hg-wc/d1/a |
|
260 | $ test -x a-hg-wc/d1/a | |
344 |
|
261 | |||
345 | Copy to new directory |
|
262 | Copy to new directory | |
346 |
|
263 | |||
347 | $ mkdir a/d2 |
|
264 | $ mkdir a/d2 | |
348 | $ hg --cwd a cp d1/a d2/a |
|
265 | $ hg --cwd a cp d1/a d2/a | |
349 | $ hg --cwd a ci -d '1 0' -A -m 'copy file to new directory' |
|
266 | $ hg --cwd a ci -d '1 0' -A -m 'copy file to new directory' | |
350 |
|
267 | |||
351 | $ hg convert -d svn a |
|
268 | $ hg convert -d svn a | |
352 | assuming destination a-hg |
|
269 | assuming destination a-hg | |
353 | initializing svn working copy 'a-hg-wc' |
|
270 | initializing svn working copy 'a-hg-wc' | |
354 | scanning source... |
|
271 | scanning source... | |
355 | sorting... |
|
272 | sorting... | |
356 | converting... |
|
273 | converting... | |
357 | 0 copy file to new directory |
|
274 | 0 copy file to new directory | |
358 | $ svnupanddisplay a-hg-wc 1 |
|
275 | $ svnupanddisplay a-hg-wc 1 | |
359 | At revision 2. |
|
|||
360 | 2 2 test . |
|
|||
361 | 2 1 test d1 |
|
276 | 2 1 test d1 | |
362 | 2 1 test d1/a |
|
277 | 2 1 test d1/a | |
|
278 | 2 2 test . | |||
363 | 2 2 test d2 |
|
279 | 2 2 test d2 | |
364 | 2 2 test d2/a |
|
280 | 2 2 test d2/a | |
365 | <?xml version="1.0"?> |
|
281 | revision: 2 | |
366 | <log> |
|
282 | author: test | |
367 | <logentry |
|
283 | msg: copy file to new directory | |
368 | revision="2"> |
|
284 | A /d2 | |
369 | <author>test</author> |
|
285 | A /d2/a (from /d1/a@1) | |
370 | <date/> |
|
|||
371 | <paths> |
|
|||
372 | <path |
|
|||
373 | action="A">/d2</path> |
|
|||
374 | <path |
|
|||
375 | copyfrom-path="/d1/a" |
|
|||
376 | copyfrom-rev="1" |
|
|||
377 | action="A">/d2/a</path> |
|
|||
378 | </paths> |
|
|||
379 | <msg>copy file to new directory</msg> |
|
|||
380 | </logentry> |
|
|||
381 | </log> |
|
|||
382 |
|
286 | |||
383 | Branchy history |
|
287 | Branchy history | |
384 |
|
288 | |||
385 | $ hg init b |
|
289 | $ hg init b | |
386 | $ echo base > b/b |
|
290 | $ echo base > b/b | |
387 | $ hg --cwd b ci -d '0 0' -Ambase |
|
291 | $ hg --cwd b ci -d '0 0' -Ambase | |
388 | adding b |
|
292 | adding b | |
389 |
|
293 | |||
390 | $ "$TESTDIR/svn-safe-append.py" left-1 b/b |
|
294 | $ "$TESTDIR/svn-safe-append.py" left-1 b/b | |
391 | $ echo left-1 > b/left-1 |
|
295 | $ echo left-1 > b/left-1 | |
392 | $ hg --cwd b ci -d '1 0' -Amleft-1 |
|
296 | $ hg --cwd b ci -d '1 0' -Amleft-1 | |
393 | adding left-1 |
|
297 | adding left-1 | |
394 |
|
298 | |||
395 | $ "$TESTDIR/svn-safe-append.py" left-2 b/b |
|
299 | $ "$TESTDIR/svn-safe-append.py" left-2 b/b | |
396 | $ echo left-2 > b/left-2 |
|
300 | $ echo left-2 > b/left-2 | |
397 | $ hg --cwd b ci -d '2 0' -Amleft-2 |
|
301 | $ hg --cwd b ci -d '2 0' -Amleft-2 | |
398 | adding left-2 |
|
302 | adding left-2 | |
399 |
|
303 | |||
400 | $ hg --cwd b up 0 |
|
304 | $ hg --cwd b up 0 | |
401 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
305 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
402 |
|
306 | |||
403 | $ "$TESTDIR/svn-safe-append.py" right-1 b/b |
|
307 | $ "$TESTDIR/svn-safe-append.py" right-1 b/b | |
404 | $ echo right-1 > b/right-1 |
|
308 | $ echo right-1 > b/right-1 | |
405 | $ hg --cwd b ci -d '3 0' -Amright-1 |
|
309 | $ hg --cwd b ci -d '3 0' -Amright-1 | |
406 | adding right-1 |
|
310 | adding right-1 | |
407 | created new head |
|
311 | created new head | |
408 |
|
312 | |||
409 | $ "$TESTDIR/svn-safe-append.py" right-2 b/b |
|
313 | $ "$TESTDIR/svn-safe-append.py" right-2 b/b | |
410 | $ echo right-2 > b/right-2 |
|
314 | $ echo right-2 > b/right-2 | |
411 | $ hg --cwd b ci -d '4 0' -Amright-2 |
|
315 | $ hg --cwd b ci -d '4 0' -Amright-2 | |
412 | adding right-2 |
|
316 | adding right-2 | |
413 |
|
317 | |||
414 | $ hg --cwd b up -C 2 |
|
318 | $ hg --cwd b up -C 2 | |
415 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
319 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
416 | $ hg --cwd b merge |
|
320 | $ hg --cwd b merge | |
417 | merging b |
|
321 | merging b | |
418 | warning: conflicts during merge. |
|
322 | warning: conflicts during merge. | |
419 | merging b incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
323 | merging b incomplete! (edit conflicts, then use 'hg resolve --mark') | |
420 | 2 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
324 | 2 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
421 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
325 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
422 | [1] |
|
326 | [1] | |
423 | $ hg --cwd b revert -r 2 b |
|
327 | $ hg --cwd b revert -r 2 b | |
424 | $ hg resolve -m b |
|
328 | $ hg resolve -m b | |
425 | $ hg --cwd b ci -d '5 0' -m 'merge' |
|
329 | $ hg --cwd b ci -d '5 0' -m 'merge' | |
426 |
|
330 | |||
427 | Expect 4 changes |
|
331 | Expect 4 changes | |
428 |
|
332 | |||
429 | $ hg convert -d svn b |
|
333 | $ hg convert -d svn b | |
430 | assuming destination b-hg |
|
334 | assuming destination b-hg | |
431 | initializing svn repository 'b-hg' |
|
335 | initializing svn repository 'b-hg' | |
432 | initializing svn working copy 'b-hg-wc' |
|
336 | initializing svn working copy 'b-hg-wc' | |
433 | scanning source... |
|
337 | scanning source... | |
434 | sorting... |
|
338 | sorting... | |
435 | converting... |
|
339 | converting... | |
436 | 5 base |
|
340 | 5 base | |
437 | 4 left-1 |
|
341 | 4 left-1 | |
438 | 3 left-2 |
|
342 | 3 left-2 | |
439 | 2 right-1 |
|
343 | 2 right-1 | |
440 | 1 right-2 |
|
344 | 1 right-2 | |
441 | 0 merge |
|
345 | 0 merge | |
442 |
|
346 | |||
443 | $ svnupanddisplay b-hg-wc 0 |
|
347 | $ svnupanddisplay b-hg-wc 0 | |
444 | At revision 4. |
|
348 | 4 2 test left-1 | |
445 | 4 4 test . |
|
|||
446 | 4 3 test b |
|
349 | 4 3 test b | |
447 | 4 2 test left-1 |
|
|||
448 | 4 3 test left-2 |
|
350 | 4 3 test left-2 | |
|
351 | 4 4 test . | |||
449 | 4 4 test right-1 |
|
352 | 4 4 test right-1 | |
450 | 4 4 test right-2 |
|
353 | 4 4 test right-2 | |
451 | <?xml version="1.0"?> |
|
354 | revision: 4 | |
452 | <log> |
|
355 | author: test | |
453 | <logentry |
|
356 | msg: merge | |
454 | revision="4"> |
|
357 | A /right-1 | |
455 | <author>test</author> |
|
358 | A /right-2 | |
456 | <date/> |
|
359 | revision: 3 | |
457 | <paths> |
|
360 | author: test | |
458 | <path |
|
361 | msg: left-2 | |
459 | action="A">/right-1</path> |
|
362 | M /b | |
460 | <path |
|
363 | A /left-2 | |
461 | action="A">/right-2</path> |
|
364 | revision: 2 | |
462 | </paths> |
|
365 | author: test | |
463 | <msg>merge</msg> |
|
366 | msg: left-1 | |
464 | </logentry> |
|
367 | M /b | |
465 | <logentry |
|
368 | A /left-1 | |
466 |
|
|
369 | revision: 1 | |
467 |
|
|
370 | author: test | |
468 | <date/> |
|
371 | msg: base | |
469 | <paths> |
|
372 | A /b | |
470 | <path |
|
|||
471 | action="M">/b</path> |
|
|||
472 | <path |
|
|||
473 | action="A">/left-2</path> |
|
|||
474 | </paths> |
|
|||
475 | <msg>left-2</msg> |
|
|||
476 | </logentry> |
|
|||
477 | <logentry |
|
|||
478 | revision="2"> |
|
|||
479 | <author>test</author> |
|
|||
480 | <date/> |
|
|||
481 | <paths> |
|
|||
482 | <path |
|
|||
483 | action="M">/b</path> |
|
|||
484 | <path |
|
|||
485 | action="A">/left-1</path> |
|
|||
486 | </paths> |
|
|||
487 | <msg>left-1</msg> |
|
|||
488 | </logentry> |
|
|||
489 | <logentry |
|
|||
490 | revision="1"> |
|
|||
491 | <author>test</author> |
|
|||
492 | <date/> |
|
|||
493 | <paths> |
|
|||
494 | <path |
|
|||
495 | action="A">/b</path> |
|
|||
496 | </paths> |
|
|||
497 | <msg>base</msg> |
|
|||
498 | </logentry> |
|
|||
499 | </log> |
|
|||
500 |
|
373 | |||
501 | Tags are not supported, but must not break conversion |
|
374 | Tags are not supported, but must not break conversion | |
502 |
|
375 | |||
503 | $ rm -rf a a-hg a-hg-wc |
|
376 | $ rm -rf a a-hg a-hg-wc | |
504 | $ hg init a |
|
377 | $ hg init a | |
505 | $ echo a > a/a |
|
378 | $ echo a > a/a | |
506 | $ hg --cwd a ci -d '0 0' -A -m 'Add file a' |
|
379 | $ hg --cwd a ci -d '0 0' -A -m 'Add file a' | |
507 | adding a |
|
380 | adding a | |
508 | $ hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0 |
|
381 | $ hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0 | |
509 |
|
382 | |||
510 | $ hg convert -d svn a |
|
383 | $ hg convert -d svn a | |
511 | assuming destination a-hg |
|
384 | assuming destination a-hg | |
512 | initializing svn repository 'a-hg' |
|
385 | initializing svn repository 'a-hg' | |
513 | initializing svn working copy 'a-hg-wc' |
|
386 | initializing svn working copy 'a-hg-wc' | |
514 | scanning source... |
|
387 | scanning source... | |
515 | sorting... |
|
388 | sorting... | |
516 | converting... |
|
389 | converting... | |
517 | 1 Add file a |
|
390 | 1 Add file a | |
518 | 0 Tagged as v1.0 |
|
391 | 0 Tagged as v1.0 | |
519 | writing Subversion tags is not yet implemented |
|
392 | writing Subversion tags is not yet implemented | |
520 | $ svnupanddisplay a-hg-wc 2 |
|
393 | $ svnupanddisplay a-hg-wc 2 | |
521 | At revision 2. |
|
394 | 2 1 test a | |
522 | 2 2 test . |
|
395 | 2 2 test . | |
523 | 2 1 test a |
|
|||
524 | 2 2 test .hgtags |
|
396 | 2 2 test .hgtags | |
525 | <?xml version="1.0"?> |
|
397 | revision: 2 | |
526 | <log> |
|
398 | author: test | |
527 | <logentry |
|
399 | msg: Tagged as v1.0 | |
528 | revision="2"> |
|
400 | A /.hgtags | |
529 | <author>test</author> |
|
401 | revision: 1 | |
530 | <date/> |
|
402 | author: test | |
531 | <paths> |
|
403 | msg: Add file a | |
532 | <path |
|
404 | A /a | |
533 | action="A">/.hgtags</path> |
|
|||
534 | </paths> |
|
|||
535 | <msg>Tagged as v1.0</msg> |
|
|||
536 | </logentry> |
|
|||
537 | <logentry |
|
|||
538 | revision="1"> |
|
|||
539 | <author>test</author> |
|
|||
540 | <date/> |
|
|||
541 | <paths> |
|
|||
542 | <path |
|
|||
543 | action="A">/a</path> |
|
|||
544 | </paths> |
|
|||
545 | <msg>Add file a</msg> |
|
|||
546 | </logentry> |
|
|||
547 | </log> |
|
|||
548 | $ rm -rf a a-hg a-hg-wc |
|
405 | $ rm -rf a a-hg a-hg-wc |
General Comments 0
You need to be logged in to leave comments.
Login now