##// END OF EJS Templates
tests: skip test-lfconvert.t if not support symblic link...
Takumi IINO -
r16325:740f20e2 stable
parent child Browse files
Show More
@@ -1,260 +1,262
1 $ "$TESTDIR/hghave" symlink || exit 80
2
1 3 $ cat >> $HGRCPATH <<EOF
2 4 > [extensions]
3 5 > largefiles =
4 6 > share =
5 7 > graphlog =
6 8 > mq =
7 9 > [largefiles]
8 10 > minsize = 0.5
9 11 > patterns = **.other
10 12 > **.dat
11 13 > EOF
12 14
13 15 "lfconvert" works
14 16 $ hg init bigfile-repo
15 17 $ cd bigfile-repo
16 18 $ cat >> .hg/hgrc <<EOF
17 19 > [extensions]
18 20 > largefiles = !
19 21 > EOF
20 22 $ mkdir sub
21 23 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
22 24 $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null
23 25 $ echo normal > normal1
24 26 $ echo alsonormal > sub/normal2
25 27 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
26 28 $ hg addremove
27 29 adding large
28 30 adding large2
29 31 adding normal1
30 32 adding sub/maybelarge.dat
31 33 adding sub/normal2
32 34 $ hg commit -m"add large, normal1" large normal1
33 35 $ hg commit -m"add sub/*" sub
34 36 Test tag parsing
35 37 $ cat >> .hgtags <<EOF
36 38 > IncorrectlyFormattedTag!
37 39 > invalidhash sometag
38 40 > 0123456789abcdef anothertag
39 41 > EOF
40 42 $ hg add .hgtags
41 43 $ hg commit -m"add large2" large2 .hgtags
42 44 $ hg rename large2 large3
43 45 Test link+rename largefile codepath
44 46 $ ln -sf large large3
45 47 $ hg commit -m"make large2 a symlink" large2 large3
46 48 $ [ -d .hg/largefiles ] && echo fail || echo pass
47 49 pass
48 50 $ cd ..
49 51 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
50 52 initializing destination largefiles-repo
51 53 skipping incorrectly formatted tag IncorrectlyFormattedTag!
52 54 skipping incorrectly formatted id invalidhash
53 55 no mapping for id 0123456789abcdef
54 56 abort: renamed/copied largefile large3 becomes symlink
55 57 [255]
56 58 $ cd bigfile-repo
57 59 $ hg strip --no-backup 2
58 60 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
59 61 $ cd ..
60 62 $ rm -rf largefiles-repo
61 63 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
62 64 initializing destination largefiles-repo
63 65
64 66 "lfconvert" converts content correctly
65 67 $ cd largefiles-repo
66 68 $ hg up
67 69 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 70 getting changed largefiles
69 71 2 largefiles updated, 0 removed
70 72 $ hg locate
71 73 .hglf/large
72 74 .hglf/sub/maybelarge.dat
73 75 normal1
74 76 sub/normal2
75 77 $ cat normal1
76 78 normal
77 79 $ cat sub/normal2
78 80 alsonormal
79 81 $ "$TESTDIR/md5sum.py" large sub/maybelarge.dat
80 82 ec87a838931d4d5d2e94a04644788a55 large
81 83 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
82 84
83 85 "lfconvert" adds 'largefiles' to .hg/requires.
84 86 $ cat .hg/requires
85 87 largefiles
86 88 revlogv1
87 89 fncache
88 90 store
89 91 dotencode
90 92
91 93 "lfconvert" includes a newline at the end of the standin files.
92 94 $ cat .hglf/large .hglf/sub/maybelarge.dat
93 95 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
94 96 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
95 97 $ cd ..
96 98
97 99 add some changesets to rename/remove/merge
98 100 $ cd bigfile-repo
99 101 $ hg mv -q sub stuff
100 102 $ hg commit -m"rename sub/ to stuff/"
101 103 $ hg update -q 1
102 104 $ echo blah >> normal3
103 105 $ echo blah >> sub/normal2
104 106 $ echo blah >> sub/maybelarge.dat
105 107 $ "$TESTDIR/md5sum.py" sub/maybelarge.dat
106 108 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
107 109 $ hg commit -A -m"add normal3, modify sub/*"
108 110 adding normal3
109 111 created new head
110 112 $ hg rm large normal3
111 113 $ hg commit -q -m"remove large, normal3"
112 114 $ hg merge
113 115 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
114 116 warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file. (glob)
115 117 merging stuff/maybelarge.dat incomplete! (edit conflicts, then use 'hg resolve --mark')
116 118 merging sub/normal2 and stuff/normal2 to stuff/normal2
117 119 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
118 120 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
119 121 [1]
120 122 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
121 123 $ hg resolve -m stuff/maybelarge.dat
122 124 $ hg commit -m"merge"
123 125 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
124 126 @ 5:4884f215abda merge
125 127 |\
126 128 | o 4:7285f817b77e remove large, normal3
127 129 | |
128 130 | o 3:67e3892e3534 add normal3, modify sub/*
129 131 | |
130 132 o | 2:c96c8beb5d56 rename sub/ to stuff/
131 133 |/
132 134 o 1:020c65d24e11 add sub/*
133 135 |
134 136 o 0:117b8328f97a add large, normal1
135 137
136 138 $ cd ..
137 139
138 140 lfconvert with rename, merge, and remove
139 141 $ rm -rf largefiles-repo
140 142 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
141 143 initializing destination largefiles-repo
142 144 $ cd largefiles-repo
143 145 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
144 146 o 5:8e05f5f2b77e merge
145 147 |\
146 148 | o 4:a5a02de7a8e4 remove large, normal3
147 149 | |
148 150 | o 3:55759520c76f add normal3, modify sub/*
149 151 | |
150 152 o | 2:261ad3f3f037 rename sub/ to stuff/
151 153 |/
152 154 o 1:334e5237836d add sub/*
153 155 |
154 156 o 0:d4892ec57ce2 add large, normal1
155 157
156 158 $ hg locate -r 2
157 159 .hglf/large
158 160 .hglf/stuff/maybelarge.dat
159 161 normal1
160 162 stuff/normal2
161 163 $ hg locate -r 3
162 164 .hglf/large
163 165 .hglf/sub/maybelarge.dat
164 166 normal1
165 167 normal3
166 168 sub/normal2
167 169 $ hg locate -r 4
168 170 .hglf/sub/maybelarge.dat
169 171 normal1
170 172 sub/normal2
171 173 $ hg locate -r 5
172 174 .hglf/stuff/maybelarge.dat
173 175 normal1
174 176 stuff/normal2
175 177 $ hg update
176 178 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 179 getting changed largefiles
178 180 1 largefiles updated, 0 removed
179 181 $ cat stuff/normal2
180 182 alsonormal
181 183 blah
182 184 $ "$TESTDIR/md5sum.py" stuff/maybelarge.dat
183 185 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
184 186 $ cat .hglf/stuff/maybelarge.dat
185 187 76236b6a2c6102826c61af4297dd738fb3b1de38
186 188 $ cd ..
187 189
188 190 "lfconvert" error cases
189 191 $ hg lfconvert http://localhost/foo foo
190 192 abort: http://localhost/foo is not a local Mercurial repo
191 193 [255]
192 194 $ hg lfconvert foo ssh://localhost/foo
193 195 abort: ssh://localhost/foo is not a local Mercurial repo
194 196 [255]
195 197 $ hg lfconvert nosuchrepo foo
196 198 abort: repository nosuchrepo not found!
197 199 [255]
198 200 $ hg share -q -U bigfile-repo shared
199 201 $ printf 'bogus' > shared/.hg/sharedpath
200 202 $ hg lfconvert shared foo
201 203 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus! (glob)
202 204 [255]
203 205 $ hg lfconvert bigfile-repo largefiles-repo
204 206 initializing destination largefiles-repo
205 207 abort: repository largefiles-repo already exists!
206 208 [255]
207 209
208 210 add another largefile to the new largefiles repo
209 211 $ cd largefiles-repo
210 212 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
211 213 $ hg add --lfsize=1 anotherlarge
212 214 $ hg commit -m "add anotherlarge (should be a largefile)"
213 215 $ cat .hglf/anotherlarge
214 216 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
215 217 $ cd ..
216 218
217 219 round-trip: converting back to a normal (non-largefiles) repo with
218 220 "lfconvert --to-normal" should give the same as ../bigfile-repo
219 221 $ cd largefiles-repo
220 222 $ hg lfconvert --to-normal . ../normal-repo
221 223 initializing destination ../normal-repo
222 224 $ cd ../normal-repo
223 225 $ cat >> .hg/hgrc <<EOF
224 226 > [extensions]
225 227 > largefiles = !
226 228 > EOF
227 229
228 230 # Hmmm: the changeset ID for rev 5 is different from the original
229 231 # normal repo (../bigfile-repo), because the changelog filelist
230 232 # differs between the two incarnations of rev 5: this repo includes
231 233 # 'large' in the list, but ../bigfile-repo does not. Since rev 5
232 234 # removes 'large' relative to the first parent in both repos, it seems
233 235 # to me that lfconvert is doing a *better* job than
234 236 # "hg remove" + "hg merge" + "hg commit".
235 237 # $ hg -R ../bigfile-repo debugdata -c 5
236 238 # $ hg debugdata -c 5
237 239 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
238 240 o 6:1635824e6f59 add anotherlarge (should be a largefile)
239 241 |
240 242 o 5:7215f8deeaaf merge
241 243 |\
242 244 | o 4:7285f817b77e remove large, normal3
243 245 | |
244 246 | o 3:67e3892e3534 add normal3, modify sub/*
245 247 | |
246 248 o | 2:c96c8beb5d56 rename sub/ to stuff/
247 249 |/
248 250 o 1:020c65d24e11 add sub/*
249 251 |
250 252 o 0:117b8328f97a add large, normal1
251 253
252 254 $ hg update
253 255 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 256 $ hg locate
255 257 anotherlarge
256 258 normal1
257 259 stuff/maybelarge.dat
258 260 stuff/normal2
259 261 $ [ -d .hg/largefiles ] && echo fail || echo pass
260 262 pass
General Comments 0
You need to be logged in to leave comments. Login now