##// END OF EJS Templates
convert/svn: fix broken symlink renames in svn sink
Patrick Mezard -
r12343:28642f7f stable
parent child Browse files
Show More
@@ -1037,7 +1037,7 b' class svn_sink(converter_sink, commandli'
1037 # our copyfile method expects to record a copy that has
1037 # our copyfile method expects to record a copy that has
1038 # already occurred. Cross the semantic gap.
1038 # already occurred. Cross the semantic gap.
1039 wdest = self.wjoin(dest)
1039 wdest = self.wjoin(dest)
1040 exists = os.path.exists(wdest)
1040 exists = os.path.lexists(wdest)
1041 if exists:
1041 if exists:
1042 fd, tempname = tempfile.mkstemp(
1042 fd, tempname = tempfile.mkstemp(
1043 prefix='hg-copy-', dir=os.path.dirname(wdest))
1043 prefix='hg-copy-', dir=os.path.dirname(wdest))
@@ -29,6 +29,7 b' hg init a'
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 ln -s a/missing a/link
32 echo % add
33 echo % add
33 hg --cwd a ci -d '0 0' -A -m 'add a file'
34 hg --cwd a ci -d '0 0' -A -m 'add a file'
34
35
@@ -43,6 +44,7 b' ls a a-hg-wc'
43 cmp a/a a-hg-wc/a && echo same || echo different
44 cmp a/a a-hg-wc/a && echo same || echo different
44
45
45 hg --cwd a mv a b
46 hg --cwd a mv a b
47 hg --cwd a mv link newlink
46 echo % rename
48 echo % rename
47 hg --cwd a ci -d '2 0' -m 'rename a file'
49 hg --cwd a ci -d '2 0' -m 'rename a file'
48 hg --cwd a tip -q
50 hg --cwd a tip -q
@@ -1,8 +1,9 b''
1 % add
1 % add
2 adding a
2 adding a
3 adding d1/d2/b
3 adding d1/d2/b
4 adding link
4 % modify
5 % modify
5 1:e0e2b8a9156b
6 1:8231f652da37
6 assuming destination a-hg
7 assuming destination a-hg
7 initializing svn repository 'a-hg'
8 initializing svn repository 'a-hg'
8 initializing svn working copy 'a-hg-wc'
9 initializing svn working copy 'a-hg-wc'
@@ -17,6 +18,7 b' At revision 2.'
17 2 1 test d1
18 2 1 test d1
18 2 1 test d1/d2
19 2 1 test d1/d2
19 2 1 test d1/d2/b
20 2 1 test d1/d2/b
21 2 1 test link
20 <?xml version="1.0"?>
22 <?xml version="1.0"?>
21 <log>
23 <log>
22 <logentry
24 <logentry
@@ -42,6 +44,8 b' At revision 2.'
42 action="A">/d1/d2</path>
44 action="A">/d1/d2</path>
43 <path
45 <path
44 action="A">/d1/d2/b</path>
46 action="A">/d1/d2/b</path>
47 <path
48 action="A">/link</path>
45 </paths>
49 </paths>
46 <msg>add a file</msg>
50 <msg>add a file</msg>
47 </logentry>
51 </logentry>
@@ -49,13 +53,15 b' At revision 2.'
49 a:
53 a:
50 a
54 a
51 d1
55 d1
56 link
52
57
53 a-hg-wc:
58 a-hg-wc:
54 a
59 a
55 d1
60 d1
61 link
56 same
62 same
57 % rename
63 % rename
58 2:eb5169441d43
64 2:a67e26ccec09
59 assuming destination a-hg
65 assuming destination a-hg
60 initializing svn working copy 'a-hg-wc'
66 initializing svn working copy 'a-hg-wc'
61 scanning source...
67 scanning source...
@@ -68,6 +74,7 b' At revision 3.'
68 3 1 test d1
74 3 1 test d1
69 3 1 test d1/d2
75 3 1 test d1/d2
70 3 1 test d1/d2/b
76 3 1 test d1/d2/b
77 3 3 test newlink
71 <?xml version="1.0"?>
78 <?xml version="1.0"?>
72 <log>
79 <log>
73 <logentry
80 <logentry
@@ -81,6 +88,12 b' At revision 3.'
81 copyfrom-path="/a"
88 copyfrom-path="/a"
82 copyfrom-rev="2"
89 copyfrom-rev="2"
83 action="A">/b</path>
90 action="A">/b</path>
91 <path
92 copyfrom-path="/link"
93 copyfrom-rev="2"
94 action="A">/newlink</path>
95 <path
96 action="D">/link</path>
84 </paths>
97 </paths>
85 <msg>rename a file</msg>
98 <msg>rename a file</msg>
86 </logentry>
99 </logentry>
@@ -88,12 +101,14 b' At revision 3.'
88 a:
101 a:
89 b
102 b
90 d1
103 d1
104 newlink
91
105
92 a-hg-wc:
106 a-hg-wc:
93 b
107 b
94 d1
108 d1
109 newlink
95 % copy
110 % copy
96 3:60effef6ab48
111 3:0cf087b9ab02
97 assuming destination a-hg
112 assuming destination a-hg
98 initializing svn working copy 'a-hg-wc'
113 initializing svn working copy 'a-hg-wc'
99 scanning source...
114 scanning source...
@@ -107,6 +122,7 b' At revision 4.'
107 4 1 test d1
122 4 1 test d1
108 4 1 test d1/d2
123 4 1 test d1/d2
109 4 1 test d1/d2/b
124 4 1 test d1/d2/b
125 4 3 test newlink
110 <?xml version="1.0"?>
126 <?xml version="1.0"?>
111 <log>
127 <log>
112 <logentry
128 <logentry
@@ -126,13 +142,15 b' a:'
126 b
142 b
127 c
143 c
128 d1
144 d1
145 newlink
129
146
130 a-hg-wc:
147 a-hg-wc:
131 b
148 b
132 c
149 c
133 d1
150 d1
151 newlink
134 % remove
152 % remove
135 4:87bbe3013fb6
153 4:07b2e34a5b17
136 assuming destination a-hg
154 assuming destination a-hg
137 initializing svn working copy 'a-hg-wc'
155 initializing svn working copy 'a-hg-wc'
138 scanning source...
156 scanning source...
@@ -145,6 +163,7 b' At revision 5.'
145 5 1 test d1
163 5 1 test d1
146 5 1 test d1/d2
164 5 1 test d1/d2
147 5 1 test d1/d2/b
165 5 1 test d1/d2/b
166 5 3 test newlink
148 <?xml version="1.0"?>
167 <?xml version="1.0"?>
149 <log>
168 <log>
150 <logentry
169 <logentry
@@ -161,12 +180,14 b' At revision 5.'
161 a:
180 a:
162 c
181 c
163 d1
182 d1
183 newlink
164
184
165 a-hg-wc:
185 a-hg-wc:
166 c
186 c
167 d1
187 d1
188 newlink
168 % executable
189 % executable
169 5:ff42e473c340
190 5:31093672760b
170 assuming destination a-hg
191 assuming destination a-hg
171 initializing svn working copy 'a-hg-wc'
192 initializing svn working copy 'a-hg-wc'
172 scanning source...
193 scanning source...
@@ -179,6 +200,7 b' At revision 6.'
179 6 1 test d1
200 6 1 test d1
180 6 1 test d1/d2
201 6 1 test d1/d2
181 6 1 test d1/d2/b
202 6 1 test d1/d2/b
203 6 3 test newlink
182 <?xml version="1.0"?>
204 <?xml version="1.0"?>
183 <log>
205 <log>
184 <logentry
206 <logentry
General Comments 0
You need to be logged in to leave comments. Login now