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