##// END OF EJS Templates
test-lfs: add coverage for the binary() fileset...
Matt Harbison -
r38434:6fcbab5c default
parent child Browse files
Show More
@@ -1,1115 +1,1119 b''
1 #require no-reposimplestore no-chg
1 #require no-reposimplestore no-chg
2
2
3 # Initial setup
3 # Initial setup
4
4
5 $ cat >> $HGRCPATH << EOF
5 $ cat >> $HGRCPATH << EOF
6 > [extensions]
6 > [extensions]
7 > lfs=
7 > lfs=
8 > [lfs]
8 > [lfs]
9 > # Test deprecated config
9 > # Test deprecated config
10 > threshold=1000B
10 > threshold=1000B
11 > EOF
11 > EOF
12
12
13 $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
14
14
15 # Prepare server and enable extension
15 # Prepare server and enable extension
16 $ hg init server
16 $ hg init server
17 $ hg clone -q server client
17 $ hg clone -q server client
18 $ cd client
18 $ cd client
19
19
20 # Commit small file
20 # Commit small file
21 $ echo s > smallfile
21 $ echo s > smallfile
22 $ echo '**.py = LF' > .hgeol
22 $ echo '**.py = LF' > .hgeol
23 $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file"
23 $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file"
24 hg: parse error: unsupported file pattern: size(">1000B")
24 hg: parse error: unsupported file pattern: size(">1000B")
25 (paths must be prefixed with "path:")
25 (paths must be prefixed with "path:")
26 [255]
26 [255]
27 $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file"
27 $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file"
28
28
29 # Commit large file
29 # Commit large file
30 $ echo $LONG > largefile
30 $ echo $LONG > largefile
31 $ grep lfs .hg/requires
31 $ grep lfs .hg/requires
32 [1]
32 [1]
33 $ hg commit --traceback -Aqm "add large file"
33 $ hg commit --traceback -Aqm "add large file"
34 $ grep lfs .hg/requires
34 $ grep lfs .hg/requires
35 lfs
35 lfs
36
36
37 # Ensure metadata is stored
37 # Ensure metadata is stored
38 $ hg debugdata largefile 0
38 $ hg debugdata largefile 0
39 version https://git-lfs.github.com/spec/v1
39 version https://git-lfs.github.com/spec/v1
40 oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
40 oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
41 size 1501
41 size 1501
42 x-is-binary 0
42 x-is-binary 0
43
43
44 # Check the blobstore is populated
44 # Check the blobstore is populated
45 $ find .hg/store/lfs/objects | sort
45 $ find .hg/store/lfs/objects | sort
46 .hg/store/lfs/objects
46 .hg/store/lfs/objects
47 .hg/store/lfs/objects/f1
47 .hg/store/lfs/objects/f1
48 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
48 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
49
49
50 # Check the blob stored contains the actual contents of the file
50 # Check the blob stored contains the actual contents of the file
51 $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
51 $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
52 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBB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CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
53
53
54 # Push changes to the server
54 # Push changes to the server
55
55
56 $ hg push
56 $ hg push
57 pushing to $TESTTMP/server
57 pushing to $TESTTMP/server
58 searching for changes
58 searching for changes
59 abort: lfs.url needs to be configured
59 abort: lfs.url needs to be configured
60 [255]
60 [255]
61
61
62 $ cat >> $HGRCPATH << EOF
62 $ cat >> $HGRCPATH << EOF
63 > [lfs]
63 > [lfs]
64 > url=file:$TESTTMP/dummy-remote/
64 > url=file:$TESTTMP/dummy-remote/
65 > EOF
65 > EOF
66
66
67 Push to a local non-lfs repo with the extension enabled will add the
67 Push to a local non-lfs repo with the extension enabled will add the
68 lfs requirement
68 lfs requirement
69
69
70 $ grep lfs $TESTTMP/server/.hg/requires
70 $ grep lfs $TESTTMP/server/.hg/requires
71 [1]
71 [1]
72 $ hg push -v | egrep -v '^(uncompressed| )'
72 $ hg push -v | egrep -v '^(uncompressed| )'
73 pushing to $TESTTMP/server
73 pushing to $TESTTMP/server
74 searching for changes
74 searching for changes
75 lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store
75 lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store
76 2 changesets found
76 2 changesets found
77 adding changesets
77 adding changesets
78 adding manifests
78 adding manifests
79 adding file changes
79 adding file changes
80 added 2 changesets with 3 changes to 3 files
80 added 2 changesets with 3 changes to 3 files
81 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
81 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
82 $ grep lfs $TESTTMP/server/.hg/requires
82 $ grep lfs $TESTTMP/server/.hg/requires
83 lfs
83 lfs
84
84
85 # Unknown URL scheme
85 # Unknown URL scheme
86
86
87 $ hg push --config lfs.url=ftp://foobar
87 $ hg push --config lfs.url=ftp://foobar
88 abort: lfs: unknown url scheme: ftp
88 abort: lfs: unknown url scheme: ftp
89 [255]
89 [255]
90
90
91 $ cd ../
91 $ cd ../
92
92
93 # Initialize new client (not cloning) and setup extension
93 # Initialize new client (not cloning) and setup extension
94 $ hg init client2
94 $ hg init client2
95 $ cd client2
95 $ cd client2
96 $ cat >> .hg/hgrc <<EOF
96 $ cat >> .hg/hgrc <<EOF
97 > [paths]
97 > [paths]
98 > default = $TESTTMP/server
98 > default = $TESTTMP/server
99 > EOF
99 > EOF
100
100
101 # Pull from server
101 # Pull from server
102
102
103 Pulling a local lfs repo into a local non-lfs repo with the extension
103 Pulling a local lfs repo into a local non-lfs repo with the extension
104 enabled adds the lfs requirement
104 enabled adds the lfs requirement
105
105
106 $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
106 $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
107 $TESTTMP/server/.hg/requires:lfs
107 $TESTTMP/server/.hg/requires:lfs
108 $ hg pull default
108 $ hg pull default
109 pulling from $TESTTMP/server
109 pulling from $TESTTMP/server
110 requesting all changes
110 requesting all changes
111 adding changesets
111 adding changesets
112 adding manifests
112 adding manifests
113 adding file changes
113 adding file changes
114 added 2 changesets with 3 changes to 3 files
114 added 2 changesets with 3 changes to 3 files
115 new changesets 0ead593177f7:b88141481348
115 new changesets 0ead593177f7:b88141481348
116 (run 'hg update' to get a working copy)
116 (run 'hg update' to get a working copy)
117 $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
117 $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
118 .hg/requires:lfs
118 .hg/requires:lfs
119 $TESTTMP/server/.hg/requires:lfs
119 $TESTTMP/server/.hg/requires:lfs
120
120
121 # Check the blobstore is not yet populated
121 # Check the blobstore is not yet populated
122 $ [ -d .hg/store/lfs/objects ]
122 $ [ -d .hg/store/lfs/objects ]
123 [1]
123 [1]
124
124
125 # Update to the last revision containing the large file
125 # Update to the last revision containing the large file
126 $ hg update
126 $ hg update
127 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
127 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
128
128
129 # Check the blobstore has been populated on update
129 # Check the blobstore has been populated on update
130 $ find .hg/store/lfs/objects | sort
130 $ find .hg/store/lfs/objects | sort
131 .hg/store/lfs/objects
131 .hg/store/lfs/objects
132 .hg/store/lfs/objects/f1
132 .hg/store/lfs/objects/f1
133 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
133 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
134
134
135 # Check the contents of the file are fetched from blobstore when requested
135 # Check the contents of the file are fetched from blobstore when requested
136 $ hg cat -r . largefile
136 $ hg cat -r . largefile
137 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
138
138
139 # Check the file has been copied in the working copy
139 # Check the file has been copied in the working copy
140 $ cat largefile
140 $ cat largefile
141 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
142
142
143 $ cd ..
143 $ cd ..
144
144
145 # Check rename, and switch between large and small files
145 # Check rename, and switch between large and small files
146
146
147 $ hg init repo3
147 $ hg init repo3
148 $ cd repo3
148 $ cd repo3
149 $ cat >> .hg/hgrc << EOF
149 $ cat >> .hg/hgrc << EOF
150 > [lfs]
150 > [lfs]
151 > track=size(">10B")
151 > track=size(">10B")
152 > EOF
152 > EOF
153
153
154 $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large
154 $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large
155 $ echo SHORTER > small
155 $ echo SHORTER > small
156 $ hg add . -q
156 $ hg add . -q
157 $ hg commit -m 'commit with lfs content'
157 $ hg commit -m 'commit with lfs content'
158
158
159 $ hg files -r . 'set:added()'
159 $ hg files -r . 'set:added()'
160 large
160 large
161 small
161 small
162 $ hg files -r . 'set:added() & lfs()'
162 $ hg files -r . 'set:added() & lfs()'
163 large
163 large
164
164
165 $ hg mv large l
165 $ hg mv large l
166 $ hg mv small s
166 $ hg mv small s
167 $ hg status 'set:removed()'
167 $ hg status 'set:removed()'
168 R large
168 R large
169 R small
169 R small
170 $ hg status 'set:removed() & lfs()'
170 $ hg status 'set:removed() & lfs()'
171 R large
171 R large
172 $ hg commit -m 'renames'
172 $ hg commit -m 'renames'
173
173
174 $ hg files -r . 'set:copied()'
174 $ hg files -r . 'set:copied()'
175 l
175 l
176 s
176 s
177 $ hg files -r . 'set:copied() & lfs()'
177 $ hg files -r . 'set:copied() & lfs()'
178 l
178 l
179 $ hg status --change . 'set:removed()'
179 $ hg status --change . 'set:removed()'
180 R large
180 R large
181 R small
181 R small
182 $ hg status --change . 'set:removed() & lfs()'
182 $ hg status --change . 'set:removed() & lfs()'
183 R large
183 R large
184
184
185 $ echo SHORT > l
185 $ echo SHORT > l
186 $ echo BECOME-LARGER-FROM-SHORTER > s
186 $ echo BECOME-LARGER-FROM-SHORTER > s
187 $ hg commit -m 'large to small, small to large'
187 $ hg commit -m 'large to small, small to large'
188
188
189 $ echo 1 >> l
189 $ echo 1 >> l
190 $ echo 2 >> s
190 $ echo 2 >> s
191 $ hg commit -m 'random modifications'
191 $ hg commit -m 'random modifications'
192
192
193 $ echo RESTORE-TO-BE-LARGE > l
193 $ echo RESTORE-TO-BE-LARGE > l
194 $ echo SHORTER > s
194 $ echo SHORTER > s
195 $ hg commit -m 'switch large and small again'
195 $ hg commit -m 'switch large and small again'
196
196
197 # Test lfs_files template
197 # Test lfs_files template
198
198
199 $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
199 $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
200 0 large
200 0 large
201 1 l, large
201 1 l, large
202 2 s
202 2 s
203 3 s
203 3 s
204 4 l
204 4 l
205
205
206 # Push and pull the above repo
206 # Push and pull the above repo
207
207
208 $ hg --cwd .. init repo4
208 $ hg --cwd .. init repo4
209 $ hg push ../repo4
209 $ hg push ../repo4
210 pushing to ../repo4
210 pushing to ../repo4
211 searching for changes
211 searching for changes
212 adding changesets
212 adding changesets
213 adding manifests
213 adding manifests
214 adding file changes
214 adding file changes
215 added 5 changesets with 10 changes to 4 files
215 added 5 changesets with 10 changes to 4 files
216
216
217 $ hg --cwd .. init repo5
217 $ hg --cwd .. init repo5
218 $ hg --cwd ../repo5 pull ../repo3
218 $ hg --cwd ../repo5 pull ../repo3
219 pulling from ../repo3
219 pulling from ../repo3
220 requesting all changes
220 requesting all changes
221 adding changesets
221 adding changesets
222 adding manifests
222 adding manifests
223 adding file changes
223 adding file changes
224 added 5 changesets with 10 changes to 4 files
224 added 5 changesets with 10 changes to 4 files
225 new changesets fd47a419c4f7:5adf850972b9
225 new changesets fd47a419c4f7:5adf850972b9
226 (run 'hg update' to get a working copy)
226 (run 'hg update' to get a working copy)
227
227
228 $ cd ..
228 $ cd ..
229
229
230 # Test clone
230 # Test clone
231
231
232 $ hg init repo6
232 $ hg init repo6
233 $ cd repo6
233 $ cd repo6
234 $ cat >> .hg/hgrc << EOF
234 $ cat >> .hg/hgrc << EOF
235 > [lfs]
235 > [lfs]
236 > track=size(">30B")
236 > track=size(">30B")
237 > EOF
237 > EOF
238
238
239 $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large
239 $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large
240 $ echo SMALL > small
240 $ echo SMALL > small
241 $ hg commit -Aqm 'create a lfs file' large small
241 $ hg commit -Aqm 'create a lfs file' large small
242 $ hg debuglfsupload -r 'all()' -v
242 $ hg debuglfsupload -r 'all()' -v
243 lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store
243 lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store
244
244
245 $ cd ..
245 $ cd ..
246
246
247 $ hg clone repo6 repo7
247 $ hg clone repo6 repo7
248 updating to branch default
248 updating to branch default
249 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
249 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 $ cd repo7
250 $ cd repo7
251 $ hg config extensions --debug | grep lfs
251 $ hg config extensions --debug | grep lfs
252 $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
252 $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
253 $ cat large
253 $ cat large
254 LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES
254 LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES
255 $ cat small
255 $ cat small
256 SMALL
256 SMALL
257
257
258 $ cd ..
258 $ cd ..
259
259
260 $ hg --config extensions.share= share repo7 sharedrepo
260 $ hg --config extensions.share= share repo7 sharedrepo
261 updating working directory
261 updating working directory
262 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 $ hg -R sharedrepo config extensions --debug | grep lfs
263 $ hg -R sharedrepo config extensions --debug | grep lfs
264 $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob)
264 $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob)
265
265
266 # Test rename and status
266 # Test rename and status
267
267
268 $ hg init repo8
268 $ hg init repo8
269 $ cd repo8
269 $ cd repo8
270 $ cat >> .hg/hgrc << EOF
270 $ cat >> .hg/hgrc << EOF
271 > [lfs]
271 > [lfs]
272 > track=size(">10B")
272 > track=size(">10B")
273 > EOF
273 > EOF
274
274
275 $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1
275 $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1
276 $ echo SMALL > a2
276 $ echo SMALL > a2
277 $ hg commit -m a -A a1 a2
277 $ hg commit -m a -A a1 a2
278 $ hg status
278 $ hg status
279 $ hg mv a1 b1
279 $ hg mv a1 b1
280 $ hg mv a2 a1
280 $ hg mv a2 a1
281 $ hg mv b1 a2
281 $ hg mv b1 a2
282 $ hg commit -m b
282 $ hg commit -m b
283 $ hg status
283 $ hg status
284 >>> with open('a2', 'wb') as f:
284 >>> with open('a2', 'wb') as f:
285 ... f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA')
285 ... f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA')
286 >>> with open('a1', 'wb') as f:
286 >>> with open('a1', 'wb') as f:
287 ... f.write(b'\1\nMETA\n')
287 ... f.write(b'\1\nMETA\n')
288 $ hg commit -m meta
288 $ hg commit -m meta
289 $ hg status
289 $ hg status
290 $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'
290 $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'
291 2: | |
291 2: | |
292 1: a1 (a2)a2 (a1) | |
292 1: a1 (a2)a2 (a1) | |
293 0: | | a1 a2
293 0: | | a1 a2
294
294
295 $ for n in a1 a2; do
295 $ for n in a1 a2; do
296 > for r in 0 1 2; do
296 > for r in 0 1 2; do
297 > printf '\n%s @ %s\n' $n $r
297 > printf '\n%s @ %s\n' $n $r
298 > hg debugdata $n $r
298 > hg debugdata $n $r
299 > done
299 > done
300 > done
300 > done
301
301
302 a1 @ 0
302 a1 @ 0
303 version https://git-lfs.github.com/spec/v1
303 version https://git-lfs.github.com/spec/v1
304 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
304 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
305 size 29
305 size 29
306 x-is-binary 0
306 x-is-binary 0
307
307
308 a1 @ 1
308 a1 @ 1
309 \x01 (esc)
309 \x01 (esc)
310 copy: a2
310 copy: a2
311 copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
311 copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
312 \x01 (esc)
312 \x01 (esc)
313 SMALL
313 SMALL
314
314
315 a1 @ 2
315 a1 @ 2
316 \x01 (esc)
316 \x01 (esc)
317 \x01 (esc)
317 \x01 (esc)
318 \x01 (esc)
318 \x01 (esc)
319 META
319 META
320
320
321 a2 @ 0
321 a2 @ 0
322 SMALL
322 SMALL
323
323
324 a2 @ 1
324 a2 @ 1
325 version https://git-lfs.github.com/spec/v1
325 version https://git-lfs.github.com/spec/v1
326 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
326 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
327 size 29
327 size 29
328 x-hg-copy a1
328 x-hg-copy a1
329 x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
329 x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
330 x-is-binary 0
330 x-is-binary 0
331
331
332 a2 @ 2
332 a2 @ 2
333 version https://git-lfs.github.com/spec/v1
333 version https://git-lfs.github.com/spec/v1
334 oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
334 oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
335 size 32
335 size 32
336 x-is-binary 0
336 x-is-binary 0
337
337
338 # Verify commit hashes include rename metadata
338 # Verify commit hashes include rename metadata
339
339
340 $ hg log -T '{rev}:{node|short} {desc}\n'
340 $ hg log -T '{rev}:{node|short} {desc}\n'
341 2:0fae949de7fa meta
341 2:0fae949de7fa meta
342 1:9cd6bdffdac0 b
342 1:9cd6bdffdac0 b
343 0:7f96794915f7 a
343 0:7f96794915f7 a
344
344
345 $ cd ..
345 $ cd ..
346
346
347 # Test bundle
347 # Test bundle
348
348
349 $ hg init repo9
349 $ hg init repo9
350 $ cd repo9
350 $ cd repo9
351 $ cat >> .hg/hgrc << EOF
351 $ cat >> .hg/hgrc << EOF
352 > [lfs]
352 > [lfs]
353 > track=size(">10B")
353 > track=size(">10B")
354 > [diff]
354 > [diff]
355 > git=1
355 > git=1
356 > EOF
356 > EOF
357
357
358 $ for i in 0 single two three 4; do
358 $ for i in 0 single two three 4; do
359 > echo 'THIS-IS-LFS-'$i > a
359 > echo 'THIS-IS-LFS-'$i > a
360 > hg commit -m a-$i -A a
360 > hg commit -m a-$i -A a
361 > done
361 > done
362
362
363 $ hg update 2 -q
363 $ hg update 2 -q
364 $ echo 'THIS-IS-LFS-2-CHILD' > a
364 $ echo 'THIS-IS-LFS-2-CHILD' > a
365 $ hg commit -m branching -q
365 $ hg commit -m branching -q
366
366
367 $ hg bundle --base 1 bundle.hg -v
367 $ hg bundle --base 1 bundle.hg -v
368 lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store
368 lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store
369 lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store
369 lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store
370 lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store
370 lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store
371 lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store
371 lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store
372 4 changesets found
372 4 changesets found
373 uncompressed size of bundle content:
373 uncompressed size of bundle content:
374 * (changelog) (glob)
374 * (changelog) (glob)
375 * (manifests) (glob)
375 * (manifests) (glob)
376 * a (glob)
376 * a (glob)
377 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
377 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
378 $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a
378 $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a
379 5 branching
379 5 branching
380 diff --git a/a b/a
380 diff --git a/a b/a
381 --- a/a
381 --- a/a
382 +++ b/a
382 +++ b/a
383 @@ -1,1 +1,1 @@
383 @@ -1,1 +1,1 @@
384 -THIS-IS-LFS-two
384 -THIS-IS-LFS-two
385 +THIS-IS-LFS-2-CHILD
385 +THIS-IS-LFS-2-CHILD
386
386
387 4 a-4
387 4 a-4
388 diff --git a/a b/a
388 diff --git a/a b/a
389 --- a/a
389 --- a/a
390 +++ b/a
390 +++ b/a
391 @@ -1,1 +1,1 @@
391 @@ -1,1 +1,1 @@
392 -THIS-IS-LFS-three
392 -THIS-IS-LFS-three
393 +THIS-IS-LFS-4
393 +THIS-IS-LFS-4
394
394
395 3 a-three
395 3 a-three
396 diff --git a/a b/a
396 diff --git a/a b/a
397 --- a/a
397 --- a/a
398 +++ b/a
398 +++ b/a
399 @@ -1,1 +1,1 @@
399 @@ -1,1 +1,1 @@
400 -THIS-IS-LFS-two
400 -THIS-IS-LFS-two
401 +THIS-IS-LFS-three
401 +THIS-IS-LFS-three
402
402
403 2 a-two
403 2 a-two
404 diff --git a/a b/a
404 diff --git a/a b/a
405 --- a/a
405 --- a/a
406 +++ b/a
406 +++ b/a
407 @@ -1,1 +1,1 @@
407 @@ -1,1 +1,1 @@
408 -THIS-IS-LFS-single
408 -THIS-IS-LFS-single
409 +THIS-IS-LFS-two
409 +THIS-IS-LFS-two
410
410
411 1 a-single
411 1 a-single
412 diff --git a/a b/a
412 diff --git a/a b/a
413 --- a/a
413 --- a/a
414 +++ b/a
414 +++ b/a
415 @@ -1,1 +1,1 @@
415 @@ -1,1 +1,1 @@
416 -THIS-IS-LFS-0
416 -THIS-IS-LFS-0
417 +THIS-IS-LFS-single
417 +THIS-IS-LFS-single
418
418
419 0 a-0
419 0 a-0
420 diff --git a/a b/a
420 diff --git a/a b/a
421 new file mode 100644
421 new file mode 100644
422 --- /dev/null
422 --- /dev/null
423 +++ b/a
423 +++ b/a
424 @@ -0,0 +1,1 @@
424 @@ -0,0 +1,1 @@
425 +THIS-IS-LFS-0
425 +THIS-IS-LFS-0
426
426
427 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
427 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
428 $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a
428 $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a
429 5 branching
429 5 branching
430 diff --git a/a b/a
430 diff --git a/a b/a
431 --- a/a
431 --- a/a
432 +++ b/a
432 +++ b/a
433 @@ -1,1 +1,1 @@
433 @@ -1,1 +1,1 @@
434 -THIS-IS-LFS-two
434 -THIS-IS-LFS-two
435 +THIS-IS-LFS-2-CHILD
435 +THIS-IS-LFS-2-CHILD
436
436
437 4 a-4
437 4 a-4
438 diff --git a/a b/a
438 diff --git a/a b/a
439 --- a/a
439 --- a/a
440 +++ b/a
440 +++ b/a
441 @@ -1,1 +1,1 @@
441 @@ -1,1 +1,1 @@
442 -THIS-IS-LFS-three
442 -THIS-IS-LFS-three
443 +THIS-IS-LFS-4
443 +THIS-IS-LFS-4
444
444
445 3 a-three
445 3 a-three
446 diff --git a/a b/a
446 diff --git a/a b/a
447 --- a/a
447 --- a/a
448 +++ b/a
448 +++ b/a
449 @@ -1,1 +1,1 @@
449 @@ -1,1 +1,1 @@
450 -THIS-IS-LFS-two
450 -THIS-IS-LFS-two
451 +THIS-IS-LFS-three
451 +THIS-IS-LFS-three
452
452
453 2 a-two
453 2 a-two
454 diff --git a/a b/a
454 diff --git a/a b/a
455 --- a/a
455 --- a/a
456 +++ b/a
456 +++ b/a
457 @@ -1,1 +1,1 @@
457 @@ -1,1 +1,1 @@
458 -THIS-IS-LFS-single
458 -THIS-IS-LFS-single
459 +THIS-IS-LFS-two
459 +THIS-IS-LFS-two
460
460
461 1 a-single
461 1 a-single
462 diff --git a/a b/a
462 diff --git a/a b/a
463 --- a/a
463 --- a/a
464 +++ b/a
464 +++ b/a
465 @@ -1,1 +1,1 @@
465 @@ -1,1 +1,1 @@
466 -THIS-IS-LFS-0
466 -THIS-IS-LFS-0
467 +THIS-IS-LFS-single
467 +THIS-IS-LFS-single
468
468
469 0 a-0
469 0 a-0
470 diff --git a/a b/a
470 diff --git a/a b/a
471 new file mode 100644
471 new file mode 100644
472 --- /dev/null
472 --- /dev/null
473 +++ b/a
473 +++ b/a
474 @@ -0,0 +1,1 @@
474 @@ -0,0 +1,1 @@
475 +THIS-IS-LFS-0
475 +THIS-IS-LFS-0
476
476
477 $ cd ..
477 $ cd ..
478
478
479 # Test isbinary
479 # Test isbinary
480
480
481 $ hg init repo10
481 $ hg init repo10
482 $ cd repo10
482 $ cd repo10
483 $ cat >> .hg/hgrc << EOF
483 $ cat >> .hg/hgrc << EOF
484 > [extensions]
484 > [extensions]
485 > lfs=
485 > lfs=
486 > [lfs]
486 > [lfs]
487 > track=all()
487 > track=all()
488 > EOF
488 > EOF
489 $ $PYTHON <<'EOF'
489 $ $PYTHON <<'EOF'
490 > def write(path, content):
490 > def write(path, content):
491 > with open(path, 'wb') as f:
491 > with open(path, 'wb') as f:
492 > f.write(content)
492 > f.write(content)
493 > write('a', b'\0\0')
493 > write('a', b'\0\0')
494 > write('b', b'\1\n')
494 > write('b', b'\1\n')
495 > write('c', b'\1\n\0')
495 > write('c', b'\1\n\0')
496 > write('d', b'xx')
496 > write('d', b'xx')
497 > EOF
497 > EOF
498 $ hg add a b c d
498 $ hg add a b c d
499 $ hg diff --stat
499 $ hg diff --stat
500 a | Bin
500 a | Bin
501 b | 1 +
501 b | 1 +
502 c | Bin
502 c | Bin
503 d | 1 +
503 d | 1 +
504 4 files changed, 2 insertions(+), 0 deletions(-)
504 4 files changed, 2 insertions(+), 0 deletions(-)
505 $ hg commit -m binarytest
505 $ hg commit -m binarytest
506 $ cat > $TESTTMP/dumpbinary.py << EOF
506 $ cat > $TESTTMP/dumpbinary.py << EOF
507 > def reposetup(ui, repo):
507 > def reposetup(ui, repo):
508 > for n in 'abcd':
508 > for n in 'abcd':
509 > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary()))
509 > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary()))
510 > EOF
510 > EOF
511 $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace
511 $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace
512 a: binary=True
512 a: binary=True
513 b: binary=False
513 b: binary=False
514 c: binary=True
514 c: binary=True
515 d: binary=False
515 d: binary=False
516 b55353847f02 tip
516 b55353847f02 tip
517
517
518 Binary blobs don't need to be present to be skipped in filesets. (And their
518 Binary blobs don't need to be present to be skipped in filesets. (And their
519 absence doesn't cause an abort.)
519 absence doesn't cause an abort.)
520
520
521 $ rm .hg/store/lfs/objects/96/a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7
521 $ rm .hg/store/lfs/objects/96/a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7
522 $ rm .hg/store/lfs/objects/92/f76135a4baf4faccb8586a60faf830c2bdfce147cefa188aaf4b790bd01b7e
522 $ rm .hg/store/lfs/objects/92/f76135a4baf4faccb8586a60faf830c2bdfce147cefa188aaf4b790bd01b7e
523
523
524 $ hg files --debug -r . 'set:eol("unix")' --config 'experimental.lfs.disableusercache=True'
524 $ hg files --debug -r . 'set:eol("unix")' --config 'experimental.lfs.disableusercache=True'
525 lfs: found c04b5bb1a5b2eb3e9cd4805420dba5a9d133da5b7adeeafb5474c4adae9faa80 in the local lfs store
525 lfs: found c04b5bb1a5b2eb3e9cd4805420dba5a9d133da5b7adeeafb5474c4adae9faa80 in the local lfs store
526 lfs: found 5dde896887f6754c9b15bfe3a441ae4806df2fde94001311e08bf110622e0bbe in the local lfs store
526 lfs: found 5dde896887f6754c9b15bfe3a441ae4806df2fde94001311e08bf110622e0bbe in the local lfs store
527 2 b
527 2 b
528
528
529 $ hg files --debug -r . 'set:binary()' --config 'experimental.lfs.disableusercache=True'
530 2 a
531 3 c
532
529 $ cd ..
533 $ cd ..
530
534
531 # Test fctx.cmp fastpath - diff without LFS blobs
535 # Test fctx.cmp fastpath - diff without LFS blobs
532
536
533 $ hg init repo12
537 $ hg init repo12
534 $ cd repo12
538 $ cd repo12
535 $ cat >> .hg/hgrc <<EOF
539 $ cat >> .hg/hgrc <<EOF
536 > [lfs]
540 > [lfs]
537 > threshold=1
541 > threshold=1
538 > EOF
542 > EOF
539 $ cat > ../patch.diff <<EOF
543 $ cat > ../patch.diff <<EOF
540 > # HG changeset patch
544 > # HG changeset patch
541 > 2
545 > 2
542 >
546 >
543 > diff --git a/a b/a
547 > diff --git a/a b/a
544 > old mode 100644
548 > old mode 100644
545 > new mode 100755
549 > new mode 100755
546 > EOF
550 > EOF
547
551
548 $ for i in 1 2 3; do
552 $ for i in 1 2 3; do
549 > cp ../repo10/a a
553 > cp ../repo10/a a
550 > if [ $i = 3 ]; then
554 > if [ $i = 3 ]; then
551 > # make a content-only change
555 > # make a content-only change
552 > hg import -q --bypass ../patch.diff
556 > hg import -q --bypass ../patch.diff
553 > hg update -q
557 > hg update -q
554 > rm ../patch.diff
558 > rm ../patch.diff
555 > else
559 > else
556 > echo $i >> a
560 > echo $i >> a
557 > hg commit -m $i -A a
561 > hg commit -m $i -A a
558 > fi
562 > fi
559 > done
563 > done
560 $ [ -d .hg/store/lfs/objects ]
564 $ [ -d .hg/store/lfs/objects ]
561
565
562 $ cd ..
566 $ cd ..
563
567
564 $ hg clone repo12 repo13 --noupdate
568 $ hg clone repo12 repo13 --noupdate
565 $ cd repo13
569 $ cd repo13
566 $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git
570 $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git
567 2
571 2
568 diff --git a/a b/a
572 diff --git a/a b/a
569 old mode 100644
573 old mode 100644
570 new mode 100755
574 new mode 100755
571
575
572 2
576 2
573 diff --git a/a b/a
577 diff --git a/a b/a
574 Binary file a has changed
578 Binary file a has changed
575
579
576 1
580 1
577 diff --git a/a b/a
581 diff --git a/a b/a
578 new file mode 100644
582 new file mode 100644
579 Binary file a has changed
583 Binary file a has changed
580
584
581 $ [ -d .hg/store/lfs/objects ]
585 $ [ -d .hg/store/lfs/objects ]
582 [1]
586 [1]
583
587
584 $ cd ..
588 $ cd ..
585
589
586 # Test filter
590 # Test filter
587
591
588 $ hg init repo11
592 $ hg init repo11
589 $ cd repo11
593 $ cd repo11
590 $ cat >> .hg/hgrc << EOF
594 $ cat >> .hg/hgrc << EOF
591 > [lfs]
595 > [lfs]
592 > track=(**.a & size(">5B")) | (**.b & !size(">5B"))
596 > track=(**.a & size(">5B")) | (**.b & !size(">5B"))
593 > | (**.c & "path:d" & !"path:d/c.c") | size(">10B")
597 > | (**.c & "path:d" & !"path:d/c.c") | size(">10B")
594 > EOF
598 > EOF
595
599
596 $ mkdir a
600 $ mkdir a
597 $ echo aaaaaa > a/1.a
601 $ echo aaaaaa > a/1.a
598 $ echo a > a/2.a
602 $ echo a > a/2.a
599 $ echo aaaaaa > 1.b
603 $ echo aaaaaa > 1.b
600 $ echo a > 2.b
604 $ echo a > 2.b
601 $ echo a > 1.c
605 $ echo a > 1.c
602 $ mkdir d
606 $ mkdir d
603 $ echo a > d/c.c
607 $ echo a > d/c.c
604 $ echo a > d/d.c
608 $ echo a > d/d.c
605 $ echo aaaaaaaaaaaa > x
609 $ echo aaaaaaaaaaaa > x
606 $ hg add . -q
610 $ hg add . -q
607 $ hg commit -m files
611 $ hg commit -m files
608
612
609 $ for p in a/1.a a/2.a 1.b 2.b 1.c d/c.c d/d.c x; do
613 $ for p in a/1.a a/2.a 1.b 2.b 1.c d/c.c d/d.c x; do
610 > if hg debugdata $p 0 2>&1 | grep git-lfs >/dev/null; then
614 > if hg debugdata $p 0 2>&1 | grep git-lfs >/dev/null; then
611 > echo "${p}: is lfs"
615 > echo "${p}: is lfs"
612 > else
616 > else
613 > echo "${p}: not lfs"
617 > echo "${p}: not lfs"
614 > fi
618 > fi
615 > done
619 > done
616 a/1.a: is lfs
620 a/1.a: is lfs
617 a/2.a: not lfs
621 a/2.a: not lfs
618 1.b: not lfs
622 1.b: not lfs
619 2.b: is lfs
623 2.b: is lfs
620 1.c: not lfs
624 1.c: not lfs
621 d/c.c: not lfs
625 d/c.c: not lfs
622 d/d.c: is lfs
626 d/d.c: is lfs
623 x: is lfs
627 x: is lfs
624
628
625 $ cd ..
629 $ cd ..
626
630
627 # Verify the repos
631 # Verify the repos
628
632
629 $ cat > $TESTTMP/dumpflog.py << EOF
633 $ cat > $TESTTMP/dumpflog.py << EOF
630 > # print raw revision sizes, flags, and hashes for certain files
634 > # print raw revision sizes, flags, and hashes for certain files
631 > import hashlib
635 > import hashlib
632 > from mercurial.node import short
636 > from mercurial.node import short
633 > from mercurial import revlog
637 > from mercurial import revlog
634 > def hash(rawtext):
638 > def hash(rawtext):
635 > h = hashlib.sha512()
639 > h = hashlib.sha512()
636 > h.update(rawtext)
640 > h.update(rawtext)
637 > return h.hexdigest()[:4]
641 > return h.hexdigest()[:4]
638 > def reposetup(ui, repo):
642 > def reposetup(ui, repo):
639 > # these 2 files are interesting
643 > # these 2 files are interesting
640 > for name in ['l', 's']:
644 > for name in ['l', 's']:
641 > fl = repo.file(name)
645 > fl = repo.file(name)
642 > if len(fl) == 0:
646 > if len(fl) == 0:
643 > continue
647 > continue
644 > sizes = [fl.rawsize(i) for i in fl]
648 > sizes = [fl.rawsize(i) for i in fl]
645 > texts = [fl.revision(i, raw=True) for i in fl]
649 > texts = [fl.revision(i, raw=True) for i in fl]
646 > flags = [int(fl.flags(i)) for i in fl]
650 > flags = [int(fl.flags(i)) for i in fl]
647 > hashes = [hash(t) for t in texts]
651 > hashes = [hash(t) for t in texts]
648 > print(' %s: rawsizes=%r flags=%r hashes=%r'
652 > print(' %s: rawsizes=%r flags=%r hashes=%r'
649 > % (name, sizes, flags, hashes))
653 > % (name, sizes, flags, hashes))
650 > EOF
654 > EOF
651
655
652 $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \
656 $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \
653 > repo10; do
657 > repo10; do
654 > echo 'repo:' $i
658 > echo 'repo:' $i
655 > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q
659 > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q
656 > done
660 > done
657 repo: client
661 repo: client
658 repo: client2
662 repo: client2
659 repo: server
663 repo: server
660 repo: repo3
664 repo: repo3
661 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
665 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
662 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
666 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
663 repo: repo4
667 repo: repo4
664 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
668 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
665 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
669 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
666 repo: repo5
670 repo: repo5
667 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
671 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
668 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
672 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
669 repo: repo6
673 repo: repo6
670 repo: repo7
674 repo: repo7
671 repo: repo8
675 repo: repo8
672 repo: repo9
676 repo: repo9
673 repo: repo10
677 repo: repo10
674
678
675 repo13 doesn't have any cached lfs files and its source never pushed its
679 repo13 doesn't have any cached lfs files and its source never pushed its
676 files. Therefore, the files don't exist in the remote store. Use the files in
680 files. Therefore, the files don't exist in the remote store. Use the files in
677 the user cache.
681 the user cache.
678
682
679 $ test -d $TESTTMP/repo13/.hg/store/lfs/objects
683 $ test -d $TESTTMP/repo13/.hg/store/lfs/objects
680 [1]
684 [1]
681
685
682 $ hg --config extensions.share= share repo13 repo14
686 $ hg --config extensions.share= share repo13 repo14
683 updating working directory
687 updating working directory
684 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
688 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
685 $ hg -R repo14 -q verify
689 $ hg -R repo14 -q verify
686
690
687 $ hg clone repo13 repo15
691 $ hg clone repo13 repo15
688 updating to branch default
692 updating to branch default
689 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
693 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
690 $ hg -R repo15 -q verify
694 $ hg -R repo15 -q verify
691
695
692 If the source repo doesn't have the blob (maybe it was pulled or cloned with
696 If the source repo doesn't have the blob (maybe it was pulled or cloned with
693 --noupdate), the blob is still accessible via the global cache to send to the
697 --noupdate), the blob is still accessible via the global cache to send to the
694 remote store.
698 remote store.
695
699
696 $ rm -rf $TESTTMP/repo15/.hg/store/lfs
700 $ rm -rf $TESTTMP/repo15/.hg/store/lfs
697 $ hg init repo16
701 $ hg init repo16
698 $ hg -R repo15 push repo16
702 $ hg -R repo15 push repo16
699 pushing to repo16
703 pushing to repo16
700 searching for changes
704 searching for changes
701 adding changesets
705 adding changesets
702 adding manifests
706 adding manifests
703 adding file changes
707 adding file changes
704 added 3 changesets with 2 changes to 1 files
708 added 3 changesets with 2 changes to 1 files
705 $ hg -R repo15 -q verify
709 $ hg -R repo15 -q verify
706
710
707 Test damaged file scenarios. (This also damages the usercache because of the
711 Test damaged file scenarios. (This also damages the usercache because of the
708 hardlinks.)
712 hardlinks.)
709
713
710 $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
714 $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
711
715
712 Repo with damaged lfs objects in any revision will fail verification.
716 Repo with damaged lfs objects in any revision will fail verification.
713
717
714 $ hg -R repo5 verify
718 $ hg -R repo5 verify
715 checking changesets
719 checking changesets
716 checking manifests
720 checking manifests
717 crosschecking files in changesets and manifests
721 crosschecking files in changesets and manifests
718 checking files
722 checking files
719 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
723 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
720 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
724 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
721 4 files, 5 changesets, 10 total revisions
725 4 files, 5 changesets, 10 total revisions
722 2 integrity errors encountered!
726 2 integrity errors encountered!
723 (first damaged changeset appears to be 0)
727 (first damaged changeset appears to be 0)
724 [1]
728 [1]
725
729
726 Updates work after cloning a damaged repo, if the damaged lfs objects aren't in
730 Updates work after cloning a damaged repo, if the damaged lfs objects aren't in
727 the update destination. Those objects won't be added to the new repo's store
731 the update destination. Those objects won't be added to the new repo's store
728 because they aren't accessed.
732 because they aren't accessed.
729
733
730 $ hg clone -v repo5 fromcorrupt
734 $ hg clone -v repo5 fromcorrupt
731 updating to branch default
735 updating to branch default
732 resolving manifests
736 resolving manifests
733 getting l
737 getting l
734 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache
738 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache
735 getting s
739 getting s
736 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
740 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
737 $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
741 $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
738 [1]
742 [1]
739
743
740 Verify will copy/link all lfs objects into the local store that aren't already
744 Verify will copy/link all lfs objects into the local store that aren't already
741 present. Bypass the corrupted usercache to show that verify works when fed by
745 present. Bypass the corrupted usercache to show that verify works when fed by
742 the (uncorrupted) remote store.
746 the (uncorrupted) remote store.
743
747
744 $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
748 $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
745 repository uses revlog format 1
749 repository uses revlog format 1
746 checking changesets
750 checking changesets
747 checking manifests
751 checking manifests
748 crosschecking files in changesets and manifests
752 crosschecking files in changesets and manifests
749 checking files
753 checking files
750 lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache
754 lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache
751 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
755 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
752 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
756 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
753 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
757 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
754 lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache
758 lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache
755 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
759 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
756 lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache
760 lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache
757 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
761 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
758 4 files, 5 changesets, 10 total revisions
762 4 files, 5 changesets, 10 total revisions
759
763
760 Verify will not copy/link a corrupted file from the usercache into the local
764 Verify will not copy/link a corrupted file from the usercache into the local
761 store, and poison it. (The verify with a good remote now works.)
765 store, and poison it. (The verify with a good remote now works.)
762
766
763 $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
767 $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
764 $ hg -R fromcorrupt verify -v
768 $ hg -R fromcorrupt verify -v
765 repository uses revlog format 1
769 repository uses revlog format 1
766 checking changesets
770 checking changesets
767 checking manifests
771 checking manifests
768 crosschecking files in changesets and manifests
772 crosschecking files in changesets and manifests
769 checking files
773 checking files
770 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
774 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
771 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
775 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
772 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
776 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
773 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
777 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
774 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
778 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
775 4 files, 5 changesets, 10 total revisions
779 4 files, 5 changesets, 10 total revisions
776 2 integrity errors encountered!
780 2 integrity errors encountered!
777 (first damaged changeset appears to be 0)
781 (first damaged changeset appears to be 0)
778 [1]
782 [1]
779 $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
783 $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
780 repository uses revlog format 1
784 repository uses revlog format 1
781 checking changesets
785 checking changesets
782 checking manifests
786 checking manifests
783 crosschecking files in changesets and manifests
787 crosschecking files in changesets and manifests
784 checking files
788 checking files
785 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache
789 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache
786 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
790 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
787 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
791 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
788 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
792 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
789 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
793 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
790 4 files, 5 changesets, 10 total revisions
794 4 files, 5 changesets, 10 total revisions
791
795
792 Damaging a file required by the update destination fails the update.
796 Damaging a file required by the update destination fails the update.
793
797
794 $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
798 $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
795 $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2
799 $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2
796 updating to branch default
800 updating to branch default
797 resolving manifests
801 resolving manifests
798 abort: corrupt remote lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
802 abort: corrupt remote lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
799 [255]
803 [255]
800
804
801 A corrupted lfs blob is not transferred from a file://remotestore to the
805 A corrupted lfs blob is not transferred from a file://remotestore to the
802 usercache or local store.
806 usercache or local store.
803
807
804 $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
808 $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
805 [1]
809 [1]
806 $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
810 $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
807 [1]
811 [1]
808
812
809 $ hg -R fromcorrupt2 verify
813 $ hg -R fromcorrupt2 verify
810 checking changesets
814 checking changesets
811 checking manifests
815 checking manifests
812 crosschecking files in changesets and manifests
816 crosschecking files in changesets and manifests
813 checking files
817 checking files
814 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
818 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
815 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
819 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
816 4 files, 5 changesets, 10 total revisions
820 4 files, 5 changesets, 10 total revisions
817 2 integrity errors encountered!
821 2 integrity errors encountered!
818 (first damaged changeset appears to be 0)
822 (first damaged changeset appears to be 0)
819 [1]
823 [1]
820
824
821 Corrupt local files are not sent upstream. (The alternate dummy remote
825 Corrupt local files are not sent upstream. (The alternate dummy remote
822 avoids the corrupt lfs object in the original remote.)
826 avoids the corrupt lfs object in the original remote.)
823
827
824 $ mkdir $TESTTMP/dummy-remote2
828 $ mkdir $TESTTMP/dummy-remote2
825 $ hg init dest
829 $ hg init dest
826 $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest
830 $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest
827 pushing to dest
831 pushing to dest
828 searching for changes
832 searching for changes
829 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
833 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
830 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
834 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
831 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
835 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
832 abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
836 abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
833 (run hg verify)
837 (run hg verify)
834 [255]
838 [255]
835
839
836 $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v
840 $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v
837 repository uses revlog format 1
841 repository uses revlog format 1
838 checking changesets
842 checking changesets
839 checking manifests
843 checking manifests
840 crosschecking files in changesets and manifests
844 crosschecking files in changesets and manifests
841 checking files
845 checking files
842 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
846 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
843 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
847 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
844 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
848 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
845 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
849 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
846 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
850 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
847 4 files, 5 changesets, 10 total revisions
851 4 files, 5 changesets, 10 total revisions
848 2 integrity errors encountered!
852 2 integrity errors encountered!
849 (first damaged changeset appears to be 0)
853 (first damaged changeset appears to be 0)
850 [1]
854 [1]
851
855
852 $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
856 $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
853 sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
857 sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
854 $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
858 $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
855 sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
859 sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
856 $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
860 $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
857 [1]
861 [1]
858
862
859 Accessing a corrupt file will complain
863 Accessing a corrupt file will complain
860
864
861 $ hg --cwd fromcorrupt2 cat -r 0 large
865 $ hg --cwd fromcorrupt2 cat -r 0 large
862 abort: integrity check failed on data/large.i:0!
866 abort: integrity check failed on data/large.i:0!
863 [255]
867 [255]
864
868
865 lfs -> normal -> lfs round trip conversions are possible. The 'none()'
869 lfs -> normal -> lfs round trip conversions are possible. The 'none()'
866 predicate on the command line will override whatever is configured globally and
870 predicate on the command line will override whatever is configured globally and
867 locally, and ensures everything converts to a regular file. For lfs -> normal,
871 locally, and ensures everything converts to a regular file. For lfs -> normal,
868 there's no 'lfs' destination repo requirement. For normal -> lfs, there is.
872 there's no 'lfs' destination repo requirement. For normal -> lfs, there is.
869
873
870 $ hg --config extensions.convert= --config 'lfs.track=none()' \
874 $ hg --config extensions.convert= --config 'lfs.track=none()' \
871 > convert repo8 convert_normal
875 > convert repo8 convert_normal
872 initializing destination convert_normal repository
876 initializing destination convert_normal repository
873 scanning source...
877 scanning source...
874 sorting...
878 sorting...
875 converting...
879 converting...
876 2 a
880 2 a
877 1 b
881 1 b
878 0 meta
882 0 meta
879 $ grep 'lfs' convert_normal/.hg/requires
883 $ grep 'lfs' convert_normal/.hg/requires
880 [1]
884 [1]
881 $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}'
885 $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}'
882 THIS-IS-LFS-BECAUSE-10-BYTES
886 THIS-IS-LFS-BECAUSE-10-BYTES
883
887
884 $ hg --config extensions.convert= --config lfs.threshold=10B \
888 $ hg --config extensions.convert= --config lfs.threshold=10B \
885 > convert convert_normal convert_lfs
889 > convert convert_normal convert_lfs
886 initializing destination convert_lfs repository
890 initializing destination convert_lfs repository
887 scanning source...
891 scanning source...
888 sorting...
892 sorting...
889 converting...
893 converting...
890 2 a
894 2 a
891 1 b
895 1 b
892 0 meta
896 0 meta
893
897
894 $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}'
898 $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}'
895 version https://git-lfs.github.com/spec/v1
899 version https://git-lfs.github.com/spec/v1
896 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
900 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
897 size 29
901 size 29
898 x-is-binary 0
902 x-is-binary 0
899 $ hg --cwd convert_lfs debugdata a1 0
903 $ hg --cwd convert_lfs debugdata a1 0
900 version https://git-lfs.github.com/spec/v1
904 version https://git-lfs.github.com/spec/v1
901 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
905 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
902 size 29
906 size 29
903 x-is-binary 0
907 x-is-binary 0
904 $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfspointer % '{key}={value}\n'}'}"
908 $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfspointer % '{key}={value}\n'}'}"
905 version=https://git-lfs.github.com/spec/v1
909 version=https://git-lfs.github.com/spec/v1
906 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
910 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
907 size=29
911 size=29
908 x-is-binary=0
912 x-is-binary=0
909 $ hg --cwd convert_lfs log -r 0 \
913 $ hg --cwd convert_lfs log -r 0 \
910 > -T '{lfs_files % "{get(lfspointer, "oid")}\n"}{lfs_files % "{lfspointer.oid}\n"}'
914 > -T '{lfs_files % "{get(lfspointer, "oid")}\n"}{lfs_files % "{lfspointer.oid}\n"}'
911 sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
915 sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
912 sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
916 sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
913 $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\n"}'
917 $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\n"}'
914 version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0
918 version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0
915 $ hg --cwd convert_lfs \
919 $ hg --cwd convert_lfs \
916 > log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}'
920 > log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}'
917 0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
921 0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
918 1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
922 1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
919 2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
923 2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
920
924
921 $ grep 'lfs' convert_lfs/.hg/requires
925 $ grep 'lfs' convert_lfs/.hg/requires
922 lfs
926 lfs
923
927
924 The hashes in all stages of the conversion are unchanged.
928 The hashes in all stages of the conversion are unchanged.
925
929
926 $ hg -R repo8 log -T '{node|short}\n'
930 $ hg -R repo8 log -T '{node|short}\n'
927 0fae949de7fa
931 0fae949de7fa
928 9cd6bdffdac0
932 9cd6bdffdac0
929 7f96794915f7
933 7f96794915f7
930 $ hg -R convert_normal log -T '{node|short}\n'
934 $ hg -R convert_normal log -T '{node|short}\n'
931 0fae949de7fa
935 0fae949de7fa
932 9cd6bdffdac0
936 9cd6bdffdac0
933 7f96794915f7
937 7f96794915f7
934 $ hg -R convert_lfs log -T '{node|short}\n'
938 $ hg -R convert_lfs log -T '{node|short}\n'
935 0fae949de7fa
939 0fae949de7fa
936 9cd6bdffdac0
940 9cd6bdffdac0
937 7f96794915f7
941 7f96794915f7
938
942
939 This convert is trickier, because it contains deleted files (via `hg mv`)
943 This convert is trickier, because it contains deleted files (via `hg mv`)
940
944
941 $ hg --config extensions.convert= --config lfs.threshold=1000M \
945 $ hg --config extensions.convert= --config lfs.threshold=1000M \
942 > convert repo3 convert_normal2
946 > convert repo3 convert_normal2
943 initializing destination convert_normal2 repository
947 initializing destination convert_normal2 repository
944 scanning source...
948 scanning source...
945 sorting...
949 sorting...
946 converting...
950 converting...
947 4 commit with lfs content
951 4 commit with lfs content
948 3 renames
952 3 renames
949 2 large to small, small to large
953 2 large to small, small to large
950 1 random modifications
954 1 random modifications
951 0 switch large and small again
955 0 switch large and small again
952 $ grep 'lfs' convert_normal2/.hg/requires
956 $ grep 'lfs' convert_normal2/.hg/requires
953 [1]
957 [1]
954 $ hg --cwd convert_normal2 debugdata large 0
958 $ hg --cwd convert_normal2 debugdata large 0
955 LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS
959 LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS
956
960
957 $ hg --config extensions.convert= --config lfs.threshold=10B \
961 $ hg --config extensions.convert= --config lfs.threshold=10B \
958 > convert convert_normal2 convert_lfs2
962 > convert convert_normal2 convert_lfs2
959 initializing destination convert_lfs2 repository
963 initializing destination convert_lfs2 repository
960 scanning source...
964 scanning source...
961 sorting...
965 sorting...
962 converting...
966 converting...
963 4 commit with lfs content
967 4 commit with lfs content
964 3 renames
968 3 renames
965 2 large to small, small to large
969 2 large to small, small to large
966 1 random modifications
970 1 random modifications
967 0 switch large and small again
971 0 switch large and small again
968 $ grep 'lfs' convert_lfs2/.hg/requires
972 $ grep 'lfs' convert_lfs2/.hg/requires
969 lfs
973 lfs
970 $ hg --cwd convert_lfs2 debugdata large 0
974 $ hg --cwd convert_lfs2 debugdata large 0
971 version https://git-lfs.github.com/spec/v1
975 version https://git-lfs.github.com/spec/v1
972 oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
976 oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
973 size 39
977 size 39
974 x-is-binary 0
978 x-is-binary 0
975
979
976 $ hg -R convert_lfs2 config --debug extensions | grep lfs
980 $ hg -R convert_lfs2 config --debug extensions | grep lfs
977 $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob)
981 $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob)
978
982
979 Committing deleted files works:
983 Committing deleted files works:
980
984
981 $ hg init $TESTTMP/repo-del
985 $ hg init $TESTTMP/repo-del
982 $ cd $TESTTMP/repo-del
986 $ cd $TESTTMP/repo-del
983 $ echo 1 > A
987 $ echo 1 > A
984 $ hg commit -m 'add A' -A A
988 $ hg commit -m 'add A' -A A
985 $ hg rm A
989 $ hg rm A
986 $ hg commit -m 'rm A'
990 $ hg commit -m 'rm A'
987
991
988 Bad .hglfs files will block the commit with a useful message
992 Bad .hglfs files will block the commit with a useful message
989
993
990 $ cat > .hglfs << EOF
994 $ cat > .hglfs << EOF
991 > [track]
995 > [track]
992 > **.test = size(">5B")
996 > **.test = size(">5B")
993 > bad file ... no commit
997 > bad file ... no commit
994 > EOF
998 > EOF
995
999
996 $ echo x > file.txt
1000 $ echo x > file.txt
997 $ hg ci -Aqm 'should fail'
1001 $ hg ci -Aqm 'should fail'
998 hg: parse error at .hglfs:3: bad file ... no commit
1002 hg: parse error at .hglfs:3: bad file ... no commit
999 [255]
1003 [255]
1000
1004
1001 $ cat > .hglfs << EOF
1005 $ cat > .hglfs << EOF
1002 > [track]
1006 > [track]
1003 > **.test = size(">5B")
1007 > **.test = size(">5B")
1004 > ** = nonexistent()
1008 > ** = nonexistent()
1005 > EOF
1009 > EOF
1006
1010
1007 $ hg ci -Aqm 'should fail'
1011 $ hg ci -Aqm 'should fail'
1008 abort: parse error in .hglfs: unknown identifier: nonexistent
1012 abort: parse error in .hglfs: unknown identifier: nonexistent
1009 [255]
1013 [255]
1010
1014
1011 '**' works out to mean all files.
1015 '**' works out to mean all files.
1012
1016
1013 $ cat > .hglfs << EOF
1017 $ cat > .hglfs << EOF
1014 > [track]
1018 > [track]
1015 > path:.hglfs = none()
1019 > path:.hglfs = none()
1016 > **.test = size(">5B")
1020 > **.test = size(">5B")
1017 > **.exclude = none()
1021 > **.exclude = none()
1018 > ** = size(">10B")
1022 > ** = size(">10B")
1019 > EOF
1023 > EOF
1020
1024
1021 The LFS policy takes effect without tracking the .hglfs file
1025 The LFS policy takes effect without tracking the .hglfs file
1022
1026
1023 $ echo 'largefile' > lfs.test
1027 $ echo 'largefile' > lfs.test
1024 $ echo '012345678901234567890' > nolfs.exclude
1028 $ echo '012345678901234567890' > nolfs.exclude
1025 $ echo '01234567890123456' > lfs.catchall
1029 $ echo '01234567890123456' > lfs.catchall
1026 $ hg add *
1030 $ hg add *
1027 $ hg ci -qm 'before add .hglfs'
1031 $ hg ci -qm 'before add .hglfs'
1028 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1032 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1029 2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1033 2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1030 lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1034 lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1031
1035
1032 The .hglfs file works when tracked
1036 The .hglfs file works when tracked
1033
1037
1034 $ echo 'largefile2' > lfs.test
1038 $ echo 'largefile2' > lfs.test
1035 $ echo '012345678901234567890a' > nolfs.exclude
1039 $ echo '012345678901234567890a' > nolfs.exclude
1036 $ echo '01234567890123456a' > lfs.catchall
1040 $ echo '01234567890123456a' > lfs.catchall
1037 $ hg ci -Aqm 'after adding .hglfs'
1041 $ hg ci -Aqm 'after adding .hglfs'
1038 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1042 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1039 3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1043 3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1040 lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1044 lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1041
1045
1042 The LFS policy stops when the .hglfs is gone
1046 The LFS policy stops when the .hglfs is gone
1043
1047
1044 $ mv .hglfs .hglfs_
1048 $ mv .hglfs .hglfs_
1045 $ echo 'largefile3' > lfs.test
1049 $ echo 'largefile3' > lfs.test
1046 $ echo '012345678901234567890abc' > nolfs.exclude
1050 $ echo '012345678901234567890abc' > nolfs.exclude
1047 $ echo '01234567890123456abc' > lfs.catchall
1051 $ echo '01234567890123456abc' > lfs.catchall
1048 $ hg ci -qm 'file test' -X .hglfs
1052 $ hg ci -qm 'file test' -X .hglfs
1049 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1053 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1050 4:
1054 4:
1051
1055
1052 $ mv .hglfs_ .hglfs
1056 $ mv .hglfs_ .hglfs
1053 $ echo '012345678901234567890abc' > lfs.test
1057 $ echo '012345678901234567890abc' > lfs.test
1054 $ hg ci -m 'back to lfs'
1058 $ hg ci -m 'back to lfs'
1055 $ hg rm lfs.test
1059 $ hg rm lfs.test
1056 $ hg ci -qm 'remove lfs'
1060 $ hg ci -qm 'remove lfs'
1057
1061
1058 {lfs_files} will list deleted files too
1062 {lfs_files} will list deleted files too
1059
1063
1060 $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}"
1064 $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}"
1061 6 lfs.test:
1065 6 lfs.test:
1062 5 lfs.test: sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6
1066 5 lfs.test: sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6
1063 3 lfs.catchall: sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1067 3 lfs.catchall: sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1064 3 lfs.test: sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1068 3 lfs.test: sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1065 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1069 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1066 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1070 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1067
1071
1068 $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
1072 $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
1069 2 lfs.catchall, lfs.test
1073 2 lfs.catchall, lfs.test
1070 3 lfs.catchall, lfs.test
1074 3 lfs.catchall, lfs.test
1071 5 lfs.test
1075 5 lfs.test
1072 6 lfs.test
1076 6 lfs.test
1073
1077
1074 $ cd ..
1078 $ cd ..
1075
1079
1076 Unbundling adds a requirement to a non-lfs repo, if necessary.
1080 Unbundling adds a requirement to a non-lfs repo, if necessary.
1077
1081
1078 $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg
1082 $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg
1079 $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg
1083 $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg
1080 $ hg init unbundle
1084 $ hg init unbundle
1081 $ hg pull -R unbundle -q nolfs.hg
1085 $ hg pull -R unbundle -q nolfs.hg
1082 $ grep lfs unbundle/.hg/requires
1086 $ grep lfs unbundle/.hg/requires
1083 [1]
1087 [1]
1084 $ hg pull -R unbundle -q lfs.hg
1088 $ hg pull -R unbundle -q lfs.hg
1085 $ grep lfs unbundle/.hg/requires
1089 $ grep lfs unbundle/.hg/requires
1086 lfs
1090 lfs
1087
1091
1088 $ hg init no_lfs
1092 $ hg init no_lfs
1089 $ cat >> no_lfs/.hg/hgrc <<EOF
1093 $ cat >> no_lfs/.hg/hgrc <<EOF
1090 > [experimental]
1094 > [experimental]
1091 > changegroup3 = True
1095 > changegroup3 = True
1092 > [extensions]
1096 > [extensions]
1093 > lfs=!
1097 > lfs=!
1094 > EOF
1098 > EOF
1095 $ cp -R no_lfs no_lfs2
1099 $ cp -R no_lfs no_lfs2
1096
1100
1097 Pushing from a local lfs repo to a local repo without an lfs requirement and
1101 Pushing from a local lfs repo to a local repo without an lfs requirement and
1098 with lfs disabled, fails.
1102 with lfs disabled, fails.
1099
1103
1100 $ hg push -R convert_lfs2 no_lfs
1104 $ hg push -R convert_lfs2 no_lfs
1101 pushing to no_lfs
1105 pushing to no_lfs
1102 abort: required features are not supported in the destination: lfs
1106 abort: required features are not supported in the destination: lfs
1103 [255]
1107 [255]
1104 $ grep lfs no_lfs/.hg/requires
1108 $ grep lfs no_lfs/.hg/requires
1105 [1]
1109 [1]
1106
1110
1107 Pulling from a local lfs repo to a local repo without an lfs requirement and
1111 Pulling from a local lfs repo to a local repo without an lfs requirement and
1108 with lfs disabled, fails.
1112 with lfs disabled, fails.
1109
1113
1110 $ hg pull -R no_lfs2 convert_lfs2
1114 $ hg pull -R no_lfs2 convert_lfs2
1111 pulling from convert_lfs2
1115 pulling from convert_lfs2
1112 abort: required features are not supported in the destination: lfs
1116 abort: required features are not supported in the destination: lfs
1113 [255]
1117 [255]
1114 $ grep lfs no_lfs2/.hg/requires
1118 $ grep lfs no_lfs2/.hg/requires
1115 [1]
1119 [1]
General Comments 0
You need to be logged in to leave comments. Login now