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