##// END OF EJS Templates
lfs-test: note a problem with unpushed lfs files and cloning/sharing...
Matt Harbison -
r35279:07687085 default
parent child Browse files
Show More
@@ -1,649 +1,678 b''
1 # Initial setup
1 # Initial setup
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > lfs=
5 > lfs=
6 > [lfs]
6 > [lfs]
7 > threshold=1000B
7 > threshold=1000B
8 > EOF
8 > EOF
9
9
10 $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
11
11
12 # Prepare server and enable extension
12 # Prepare server and enable extension
13 $ hg init server
13 $ hg init server
14 $ hg clone -q server client
14 $ hg clone -q server client
15 $ cd client
15 $ cd client
16
16
17 # Commit small file
17 # Commit small file
18 $ echo s > smallfile
18 $ echo s > smallfile
19 $ hg commit -Aqm "add small file"
19 $ hg commit -Aqm "add small file"
20
20
21 # Commit large file
21 # Commit large file
22 $ echo $LONG > largefile
22 $ echo $LONG > largefile
23 $ grep lfs .hg/requires
23 $ grep lfs .hg/requires
24 [1]
24 [1]
25 $ hg commit --traceback -Aqm "add large file"
25 $ hg commit --traceback -Aqm "add large file"
26 $ grep lfs .hg/requires
26 $ grep lfs .hg/requires
27 lfs
27 lfs
28
28
29 # Ensure metadata is stored
29 # Ensure metadata is stored
30 $ hg debugdata largefile 0
30 $ hg debugdata largefile 0
31 version https://git-lfs.github.com/spec/v1
31 version https://git-lfs.github.com/spec/v1
32 oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
32 oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
33 size 1501
33 size 1501
34 x-is-binary 0
34 x-is-binary 0
35
35
36 # Check the blobstore is populated
36 # Check the blobstore is populated
37 $ find .hg/store/lfs/objects | sort
37 $ find .hg/store/lfs/objects | sort
38 .hg/store/lfs/objects
38 .hg/store/lfs/objects
39 .hg/store/lfs/objects/f1
39 .hg/store/lfs/objects/f1
40 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
40 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
41
41
42 # Check the blob stored contains the actual contents of the file
42 # Check the blob stored contains the actual contents of the file
43 $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
43 $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
44 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
45
45
46 # Push changes to the server
46 # Push changes to the server
47
47
48 $ hg push
48 $ hg push
49 pushing to $TESTTMP/server (glob)
49 pushing to $TESTTMP/server (glob)
50 searching for changes
50 searching for changes
51 abort: lfs.url needs to be configured
51 abort: lfs.url needs to be configured
52 [255]
52 [255]
53
53
54 $ cat >> $HGRCPATH << EOF
54 $ cat >> $HGRCPATH << EOF
55 > [lfs]
55 > [lfs]
56 > url=file:$TESTTMP/dummy-remote/
56 > url=file:$TESTTMP/dummy-remote/
57 > EOF
57 > EOF
58
58
59 $ hg push -v | egrep -v '^(uncompressed| )'
59 $ hg push -v | egrep -v '^(uncompressed| )'
60 pushing to $TESTTMP/server (glob)
60 pushing to $TESTTMP/server (glob)
61 searching for changes
61 searching for changes
62 2 changesets found
62 2 changesets found
63 adding changesets
63 adding changesets
64 adding manifests
64 adding manifests
65 adding file changes
65 adding file changes
66 added 2 changesets with 2 changes to 2 files
66 added 2 changesets with 2 changes to 2 files
67
67
68 # Unknown URL scheme
68 # Unknown URL scheme
69
69
70 $ hg push --config lfs.url=ftp://foobar
70 $ hg push --config lfs.url=ftp://foobar
71 abort: lfs: unknown url scheme: ftp
71 abort: lfs: unknown url scheme: ftp
72 [255]
72 [255]
73
73
74 $ cd ../
74 $ cd ../
75
75
76 # Initialize new client (not cloning) and setup extension
76 # Initialize new client (not cloning) and setup extension
77 $ hg init client2
77 $ hg init client2
78 $ cd client2
78 $ cd client2
79 $ cat >> .hg/hgrc <<EOF
79 $ cat >> .hg/hgrc <<EOF
80 > [paths]
80 > [paths]
81 > default = $TESTTMP/server
81 > default = $TESTTMP/server
82 > EOF
82 > EOF
83
83
84 # Pull from server
84 # Pull from server
85 $ hg pull default
85 $ hg pull default
86 pulling from $TESTTMP/server (glob)
86 pulling from $TESTTMP/server (glob)
87 requesting all changes
87 requesting all changes
88 adding changesets
88 adding changesets
89 adding manifests
89 adding manifests
90 adding file changes
90 adding file changes
91 added 2 changesets with 2 changes to 2 files
91 added 2 changesets with 2 changes to 2 files
92 new changesets b29ba743f89d:00c137947d30
92 new changesets b29ba743f89d:00c137947d30
93 (run 'hg update' to get a working copy)
93 (run 'hg update' to get a working copy)
94
94
95 # Check the blobstore is not yet populated
95 # Check the blobstore is not yet populated
96 $ [ -d .hg/store/lfs/objects ]
96 $ [ -d .hg/store/lfs/objects ]
97 [1]
97 [1]
98
98
99 # Update to the last revision containing the large file
99 # Update to the last revision containing the large file
100 $ hg update
100 $ hg update
101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
102
102
103 # Check the blobstore has been populated on update
103 # Check the blobstore has been populated on update
104 $ find .hg/store/lfs/objects | sort
104 $ find .hg/store/lfs/objects | sort
105 .hg/store/lfs/objects
105 .hg/store/lfs/objects
106 .hg/store/lfs/objects/f1
106 .hg/store/lfs/objects/f1
107 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
107 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
108
108
109 # Check the contents of the file are fetched from blobstore when requested
109 # Check the contents of the file are fetched from blobstore when requested
110 $ hg cat -r . largefile
110 $ hg cat -r . largefile
111 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
112
112
113 # Check the file has been copied in the working copy
113 # Check the file has been copied in the working copy
114 $ cat largefile
114 $ cat largefile
115 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
116
116
117 $ cd ..
117 $ cd ..
118
118
119 # Check rename, and switch between large and small files
119 # Check rename, and switch between large and small files
120
120
121 $ hg init repo3
121 $ hg init repo3
122 $ cd repo3
122 $ cd repo3
123 $ cat >> .hg/hgrc << EOF
123 $ cat >> .hg/hgrc << EOF
124 > [lfs]
124 > [lfs]
125 > threshold=10B
125 > threshold=10B
126 > EOF
126 > EOF
127
127
128 $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large
128 $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large
129 $ echo SHORTER > small
129 $ echo SHORTER > small
130 $ hg add . -q
130 $ hg add . -q
131 $ hg commit -m 'commit with lfs content'
131 $ hg commit -m 'commit with lfs content'
132
132
133 $ hg mv large l
133 $ hg mv large l
134 $ hg mv small s
134 $ hg mv small s
135 $ hg commit -m 'renames'
135 $ hg commit -m 'renames'
136
136
137 $ echo SHORT > l
137 $ echo SHORT > l
138 $ echo BECOME-LARGER-FROM-SHORTER > s
138 $ echo BECOME-LARGER-FROM-SHORTER > s
139 $ hg commit -m 'large to small, small to large'
139 $ hg commit -m 'large to small, small to large'
140
140
141 $ echo 1 >> l
141 $ echo 1 >> l
142 $ echo 2 >> s
142 $ echo 2 >> s
143 $ hg commit -m 'random modifications'
143 $ hg commit -m 'random modifications'
144
144
145 $ echo RESTORE-TO-BE-LARGE > l
145 $ echo RESTORE-TO-BE-LARGE > l
146 $ echo SHORTER > s
146 $ echo SHORTER > s
147 $ hg commit -m 'switch large and small again'
147 $ hg commit -m 'switch large and small again'
148
148
149 # Test lfs_files template
149 # Test lfs_files template
150
150
151 $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
151 $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
152 0 large
152 0 large
153 1 l
153 1 l
154 2 s
154 2 s
155 3 s
155 3 s
156 4 l
156 4 l
157
157
158 # Push and pull the above repo
158 # Push and pull the above repo
159
159
160 $ hg --cwd .. init repo4
160 $ hg --cwd .. init repo4
161 $ hg push ../repo4
161 $ hg push ../repo4
162 pushing to ../repo4
162 pushing to ../repo4
163 searching for changes
163 searching for changes
164 adding changesets
164 adding changesets
165 adding manifests
165 adding manifests
166 adding file changes
166 adding file changes
167 added 5 changesets with 10 changes to 4 files
167 added 5 changesets with 10 changes to 4 files
168
168
169 $ hg --cwd .. init repo5
169 $ hg --cwd .. init repo5
170 $ hg --cwd ../repo5 pull ../repo3
170 $ hg --cwd ../repo5 pull ../repo3
171 pulling from ../repo3
171 pulling from ../repo3
172 requesting all changes
172 requesting all changes
173 adding changesets
173 adding changesets
174 adding manifests
174 adding manifests
175 adding file changes
175 adding file changes
176 added 5 changesets with 10 changes to 4 files
176 added 5 changesets with 10 changes to 4 files
177 new changesets fd47a419c4f7:5adf850972b9
177 new changesets fd47a419c4f7:5adf850972b9
178 (run 'hg update' to get a working copy)
178 (run 'hg update' to get a working copy)
179
179
180 $ cd ..
180 $ cd ..
181
181
182 # Test clone
182 # Test clone
183
183
184 $ hg init repo6
184 $ hg init repo6
185 $ cd repo6
185 $ cd repo6
186 $ cat >> .hg/hgrc << EOF
186 $ cat >> .hg/hgrc << EOF
187 > [lfs]
187 > [lfs]
188 > threshold=30B
188 > threshold=30B
189 > EOF
189 > EOF
190
190
191 $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large
191 $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large
192 $ echo SMALL > small
192 $ echo SMALL > small
193 $ hg commit -Aqm 'create a lfs file' large small
193 $ hg commit -Aqm 'create a lfs file' large small
194 $ hg debuglfsupload -r 'all()' -v
194 $ hg debuglfsupload -r 'all()' -v
195
195
196 $ cd ..
196 $ cd ..
197
197
198 $ hg clone repo6 repo7
198 $ hg clone repo6 repo7
199 updating to branch default
199 updating to branch default
200 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
200 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
201 $ cd repo7
201 $ cd repo7
202 $ hg config extensions --debug | grep lfs
202 $ hg config extensions --debug | grep lfs
203 $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
203 $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
204 $ cat large
204 $ cat large
205 LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES
205 LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES
206 $ cat small
206 $ cat small
207 SMALL
207 SMALL
208
208
209 $ cd ..
209 $ cd ..
210
210
211 $ hg --config extensions.share= share repo7 sharedrepo
211 $ hg --config extensions.share= share repo7 sharedrepo
212 updating working directory
212 updating working directory
213 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
214 $ hg -R sharedrepo config extensions --debug | grep lfs
214 $ hg -R sharedrepo config extensions --debug | grep lfs
215 $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob)
215 $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob)
216
216
217 # Test rename and status
217 # Test rename and status
218
218
219 $ hg init repo8
219 $ hg init repo8
220 $ cd repo8
220 $ cd repo8
221 $ cat >> .hg/hgrc << EOF
221 $ cat >> .hg/hgrc << EOF
222 > [lfs]
222 > [lfs]
223 > threshold=10B
223 > threshold=10B
224 > EOF
224 > EOF
225
225
226 $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1
226 $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1
227 $ echo SMALL > a2
227 $ echo SMALL > a2
228 $ hg commit -m a -A a1 a2
228 $ hg commit -m a -A a1 a2
229 $ hg status
229 $ hg status
230 $ hg mv a1 b1
230 $ hg mv a1 b1
231 $ hg mv a2 a1
231 $ hg mv a2 a1
232 $ hg mv b1 a2
232 $ hg mv b1 a2
233 $ hg commit -m b
233 $ hg commit -m b
234 $ hg status
234 $ hg status
235 $ HEADER=$'\1\n'
235 $ HEADER=$'\1\n'
236 $ printf '%sSTART-WITH-HG-FILELOG-METADATA' "$HEADER" > a2
236 $ printf '%sSTART-WITH-HG-FILELOG-METADATA' "$HEADER" > a2
237 $ printf '%sMETA\n' "$HEADER" > a1
237 $ printf '%sMETA\n' "$HEADER" > a1
238 $ hg commit -m meta
238 $ hg commit -m meta
239 $ hg status
239 $ hg status
240 $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'
240 $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'
241 2: | |
241 2: | |
242 1: a1 (a2)a2 (a1) | |
242 1: a1 (a2)a2 (a1) | |
243 0: | | a1 a2
243 0: | | a1 a2
244
244
245 $ for n in a1 a2; do
245 $ for n in a1 a2; do
246 > for r in 0 1 2; do
246 > for r in 0 1 2; do
247 > printf '\n%s @ %s\n' $n $r
247 > printf '\n%s @ %s\n' $n $r
248 > hg debugdata $n $r
248 > hg debugdata $n $r
249 > done
249 > done
250 > done
250 > done
251
251
252 a1 @ 0
252 a1 @ 0
253 version https://git-lfs.github.com/spec/v1
253 version https://git-lfs.github.com/spec/v1
254 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
254 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
255 size 29
255 size 29
256 x-is-binary 0
256 x-is-binary 0
257
257
258 a1 @ 1
258 a1 @ 1
259 \x01 (esc)
259 \x01 (esc)
260 copy: a2
260 copy: a2
261 copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
261 copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
262 \x01 (esc)
262 \x01 (esc)
263 SMALL
263 SMALL
264
264
265 a1 @ 2
265 a1 @ 2
266 \x01 (esc)
266 \x01 (esc)
267 \x01 (esc)
267 \x01 (esc)
268 \x01 (esc)
268 \x01 (esc)
269 META
269 META
270
270
271 a2 @ 0
271 a2 @ 0
272 SMALL
272 SMALL
273
273
274 a2 @ 1
274 a2 @ 1
275 version https://git-lfs.github.com/spec/v1
275 version https://git-lfs.github.com/spec/v1
276 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
276 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
277 size 29
277 size 29
278 x-hg-copy a1
278 x-hg-copy a1
279 x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
279 x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
280 x-is-binary 0
280 x-is-binary 0
281
281
282 a2 @ 2
282 a2 @ 2
283 version https://git-lfs.github.com/spec/v1
283 version https://git-lfs.github.com/spec/v1
284 oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
284 oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
285 size 32
285 size 32
286 x-is-binary 0
286 x-is-binary 0
287
287
288 # Verify commit hashes include rename metadata
288 # Verify commit hashes include rename metadata
289
289
290 $ hg log -T '{rev}:{node|short} {desc}\n'
290 $ hg log -T '{rev}:{node|short} {desc}\n'
291 2:0fae949de7fa meta
291 2:0fae949de7fa meta
292 1:9cd6bdffdac0 b
292 1:9cd6bdffdac0 b
293 0:7f96794915f7 a
293 0:7f96794915f7 a
294
294
295 $ cd ..
295 $ cd ..
296
296
297 # Test bundle
297 # Test bundle
298
298
299 $ hg init repo9
299 $ hg init repo9
300 $ cd repo9
300 $ cd repo9
301 $ cat >> .hg/hgrc << EOF
301 $ cat >> .hg/hgrc << EOF
302 > [lfs]
302 > [lfs]
303 > threshold=10B
303 > threshold=10B
304 > [diff]
304 > [diff]
305 > git=1
305 > git=1
306 > EOF
306 > EOF
307
307
308 $ for i in 0 single two three 4; do
308 $ for i in 0 single two three 4; do
309 > echo 'THIS-IS-LFS-'$i > a
309 > echo 'THIS-IS-LFS-'$i > a
310 > hg commit -m a-$i -A a
310 > hg commit -m a-$i -A a
311 > done
311 > done
312
312
313 $ hg update 2 -q
313 $ hg update 2 -q
314 $ echo 'THIS-IS-LFS-2-CHILD' > a
314 $ echo 'THIS-IS-LFS-2-CHILD' > a
315 $ hg commit -m branching -q
315 $ hg commit -m branching -q
316
316
317 $ hg bundle --base 1 bundle.hg -v
317 $ hg bundle --base 1 bundle.hg -v
318 4 changesets found
318 4 changesets found
319 uncompressed size of bundle content:
319 uncompressed size of bundle content:
320 * (changelog) (glob)
320 * (changelog) (glob)
321 * (manifests) (glob)
321 * (manifests) (glob)
322 * a (glob)
322 * a (glob)
323 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
323 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
324 $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a
324 $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a
325 5 branching
325 5 branching
326 diff --git a/a b/a
326 diff --git a/a b/a
327 --- a/a
327 --- a/a
328 +++ b/a
328 +++ b/a
329 @@ -1,1 +1,1 @@
329 @@ -1,1 +1,1 @@
330 -THIS-IS-LFS-two
330 -THIS-IS-LFS-two
331 +THIS-IS-LFS-2-CHILD
331 +THIS-IS-LFS-2-CHILD
332
332
333 4 a-4
333 4 a-4
334 diff --git a/a b/a
334 diff --git a/a b/a
335 --- a/a
335 --- a/a
336 +++ b/a
336 +++ b/a
337 @@ -1,1 +1,1 @@
337 @@ -1,1 +1,1 @@
338 -THIS-IS-LFS-three
338 -THIS-IS-LFS-three
339 +THIS-IS-LFS-4
339 +THIS-IS-LFS-4
340
340
341 3 a-three
341 3 a-three
342 diff --git a/a b/a
342 diff --git a/a b/a
343 --- a/a
343 --- a/a
344 +++ b/a
344 +++ b/a
345 @@ -1,1 +1,1 @@
345 @@ -1,1 +1,1 @@
346 -THIS-IS-LFS-two
346 -THIS-IS-LFS-two
347 +THIS-IS-LFS-three
347 +THIS-IS-LFS-three
348
348
349 2 a-two
349 2 a-two
350 diff --git a/a b/a
350 diff --git a/a b/a
351 --- a/a
351 --- a/a
352 +++ b/a
352 +++ b/a
353 @@ -1,1 +1,1 @@
353 @@ -1,1 +1,1 @@
354 -THIS-IS-LFS-single
354 -THIS-IS-LFS-single
355 +THIS-IS-LFS-two
355 +THIS-IS-LFS-two
356
356
357 1 a-single
357 1 a-single
358 diff --git a/a b/a
358 diff --git a/a b/a
359 --- a/a
359 --- a/a
360 +++ b/a
360 +++ b/a
361 @@ -1,1 +1,1 @@
361 @@ -1,1 +1,1 @@
362 -THIS-IS-LFS-0
362 -THIS-IS-LFS-0
363 +THIS-IS-LFS-single
363 +THIS-IS-LFS-single
364
364
365 0 a-0
365 0 a-0
366 diff --git a/a b/a
366 diff --git a/a b/a
367 new file mode 100644
367 new file mode 100644
368 --- /dev/null
368 --- /dev/null
369 +++ b/a
369 +++ b/a
370 @@ -0,0 +1,1 @@
370 @@ -0,0 +1,1 @@
371 +THIS-IS-LFS-0
371 +THIS-IS-LFS-0
372
372
373 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
373 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
374 $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a
374 $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a
375 5 branching
375 5 branching
376 diff --git a/a b/a
376 diff --git a/a b/a
377 --- a/a
377 --- a/a
378 +++ b/a
378 +++ b/a
379 @@ -1,1 +1,1 @@
379 @@ -1,1 +1,1 @@
380 -THIS-IS-LFS-two
380 -THIS-IS-LFS-two
381 +THIS-IS-LFS-2-CHILD
381 +THIS-IS-LFS-2-CHILD
382
382
383 4 a-4
383 4 a-4
384 diff --git a/a b/a
384 diff --git a/a b/a
385 --- a/a
385 --- a/a
386 +++ b/a
386 +++ b/a
387 @@ -1,1 +1,1 @@
387 @@ -1,1 +1,1 @@
388 -THIS-IS-LFS-three
388 -THIS-IS-LFS-three
389 +THIS-IS-LFS-4
389 +THIS-IS-LFS-4
390
390
391 3 a-three
391 3 a-three
392 diff --git a/a b/a
392 diff --git a/a b/a
393 --- a/a
393 --- a/a
394 +++ b/a
394 +++ b/a
395 @@ -1,1 +1,1 @@
395 @@ -1,1 +1,1 @@
396 -THIS-IS-LFS-two
396 -THIS-IS-LFS-two
397 +THIS-IS-LFS-three
397 +THIS-IS-LFS-three
398
398
399 2 a-two
399 2 a-two
400 diff --git a/a b/a
400 diff --git a/a b/a
401 --- a/a
401 --- a/a
402 +++ b/a
402 +++ b/a
403 @@ -1,1 +1,1 @@
403 @@ -1,1 +1,1 @@
404 -THIS-IS-LFS-single
404 -THIS-IS-LFS-single
405 +THIS-IS-LFS-two
405 +THIS-IS-LFS-two
406
406
407 1 a-single
407 1 a-single
408 diff --git a/a b/a
408 diff --git a/a b/a
409 --- a/a
409 --- a/a
410 +++ b/a
410 +++ b/a
411 @@ -1,1 +1,1 @@
411 @@ -1,1 +1,1 @@
412 -THIS-IS-LFS-0
412 -THIS-IS-LFS-0
413 +THIS-IS-LFS-single
413 +THIS-IS-LFS-single
414
414
415 0 a-0
415 0 a-0
416 diff --git a/a b/a
416 diff --git a/a b/a
417 new file mode 100644
417 new file mode 100644
418 --- /dev/null
418 --- /dev/null
419 +++ b/a
419 +++ b/a
420 @@ -0,0 +1,1 @@
420 @@ -0,0 +1,1 @@
421 +THIS-IS-LFS-0
421 +THIS-IS-LFS-0
422
422
423 $ cd ..
423 $ cd ..
424
424
425 # Test isbinary
425 # Test isbinary
426
426
427 $ hg init repo10
427 $ hg init repo10
428 $ cd repo10
428 $ cd repo10
429 $ cat >> .hg/hgrc << EOF
429 $ cat >> .hg/hgrc << EOF
430 > [extensions]
430 > [extensions]
431 > lfs=
431 > lfs=
432 > [lfs]
432 > [lfs]
433 > threshold=1
433 > threshold=1
434 > EOF
434 > EOF
435 $ $PYTHON <<'EOF'
435 $ $PYTHON <<'EOF'
436 > def write(path, content):
436 > def write(path, content):
437 > with open(path, 'wb') as f:
437 > with open(path, 'wb') as f:
438 > f.write(content)
438 > f.write(content)
439 > write('a', b'\0\0')
439 > write('a', b'\0\0')
440 > write('b', b'\1\n')
440 > write('b', b'\1\n')
441 > write('c', b'\1\n\0')
441 > write('c', b'\1\n\0')
442 > write('d', b'xx')
442 > write('d', b'xx')
443 > EOF
443 > EOF
444 $ hg add a b c d
444 $ hg add a b c d
445 $ hg diff --stat
445 $ hg diff --stat
446 a | Bin
446 a | Bin
447 b | 1 +
447 b | 1 +
448 c | Bin
448 c | Bin
449 d | 1 +
449 d | 1 +
450 4 files changed, 2 insertions(+), 0 deletions(-)
450 4 files changed, 2 insertions(+), 0 deletions(-)
451 $ hg commit -m binarytest
451 $ hg commit -m binarytest
452 $ cat > $TESTTMP/dumpbinary.py << EOF
452 $ cat > $TESTTMP/dumpbinary.py << EOF
453 > def reposetup(ui, repo):
453 > def reposetup(ui, repo):
454 > for n in 'abcd':
454 > for n in 'abcd':
455 > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary()))
455 > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary()))
456 > EOF
456 > EOF
457 $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace
457 $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace
458 a: binary=True
458 a: binary=True
459 b: binary=False
459 b: binary=False
460 c: binary=True
460 c: binary=True
461 d: binary=False
461 d: binary=False
462 b55353847f02 tip
462 b55353847f02 tip
463
463
464 $ cd ..
464 $ cd ..
465
465
466 # Test fctx.cmp fastpath - diff without LFS blobs
466 # Test fctx.cmp fastpath - diff without LFS blobs
467
467
468 $ hg init repo11
468 $ hg init repo11
469 $ cd repo11
469 $ cd repo11
470 $ cat >> .hg/hgrc <<EOF
470 $ cat >> .hg/hgrc <<EOF
471 > [lfs]
471 > [lfs]
472 > threshold=1
472 > threshold=1
473 > EOF
473 > EOF
474 $ cat > ../patch.diff <<EOF
474 $ cat > ../patch.diff <<EOF
475 > # HG changeset patch
475 > # HG changeset patch
476 > 2
476 > 2
477 >
477 >
478 > diff --git a/a b/a
478 > diff --git a/a b/a
479 > old mode 100644
479 > old mode 100644
480 > new mode 100755
480 > new mode 100755
481 > EOF
481 > EOF
482
482
483 $ for i in 1 2 3; do
483 $ for i in 1 2 3; do
484 > cp ../repo10/a a
484 > cp ../repo10/a a
485 > if [ $i = 3 ]; then
485 > if [ $i = 3 ]; then
486 > # make a content-only change
486 > # make a content-only change
487 > hg import -q --bypass ../patch.diff
487 > hg import -q --bypass ../patch.diff
488 > hg update -q
488 > hg update -q
489 > rm ../patch.diff
489 > rm ../patch.diff
490 > else
490 > else
491 > echo $i >> a
491 > echo $i >> a
492 > hg commit -m $i -A a
492 > hg commit -m $i -A a
493 > fi
493 > fi
494 > done
494 > done
495 $ [ -d .hg/store/lfs/objects ]
495 $ [ -d .hg/store/lfs/objects ]
496
496
497 $ cd ..
497 $ cd ..
498
498
499 $ hg clone repo11 repo12 --noupdate
499 $ hg clone repo11 repo12 --noupdate
500 $ cd repo12
500 $ cd repo12
501 $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git
501 $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git
502 2
502 2
503 diff --git a/a b/a
503 diff --git a/a b/a
504 old mode 100644
504 old mode 100644
505 new mode 100755
505 new mode 100755
506
506
507 2
507 2
508 diff --git a/a b/a
508 diff --git a/a b/a
509 Binary file a has changed
509 Binary file a has changed
510
510
511 1
511 1
512 diff --git a/a b/a
512 diff --git a/a b/a
513 new file mode 100644
513 new file mode 100644
514 Binary file a has changed
514 Binary file a has changed
515
515
516 $ [ -d .hg/store/lfs/objects ]
516 $ [ -d .hg/store/lfs/objects ]
517 [1]
517 [1]
518
518
519 $ cd ..
519 $ cd ..
520
520
521 # Verify the repos
521 # Verify the repos
522
522
523 $ cat > $TESTTMP/dumpflog.py << EOF
523 $ cat > $TESTTMP/dumpflog.py << EOF
524 > # print raw revision sizes, flags, and hashes for certain files
524 > # print raw revision sizes, flags, and hashes for certain files
525 > import hashlib
525 > import hashlib
526 > from mercurial import revlog
526 > from mercurial import revlog
527 > from mercurial.node import short
527 > from mercurial.node import short
528 > def hash(rawtext):
528 > def hash(rawtext):
529 > h = hashlib.sha512()
529 > h = hashlib.sha512()
530 > h.update(rawtext)
530 > h.update(rawtext)
531 > return h.hexdigest()[:4]
531 > return h.hexdigest()[:4]
532 > def reposetup(ui, repo):
532 > def reposetup(ui, repo):
533 > # these 2 files are interesting
533 > # these 2 files are interesting
534 > for name in ['l', 's']:
534 > for name in ['l', 's']:
535 > fl = repo.file(name)
535 > fl = repo.file(name)
536 > if len(fl) == 0:
536 > if len(fl) == 0:
537 > continue
537 > continue
538 > sizes = [revlog.revlog.rawsize(fl, i) for i in fl]
538 > sizes = [revlog.revlog.rawsize(fl, i) for i in fl]
539 > texts = [fl.revision(i, raw=True) for i in fl]
539 > texts = [fl.revision(i, raw=True) for i in fl]
540 > flags = [int(fl.flags(i)) for i in fl]
540 > flags = [int(fl.flags(i)) for i in fl]
541 > hashes = [hash(t) for t in texts]
541 > hashes = [hash(t) for t in texts]
542 > print(' %s: rawsizes=%r flags=%r hashes=%r'
542 > print(' %s: rawsizes=%r flags=%r hashes=%r'
543 > % (name, sizes, flags, hashes))
543 > % (name, sizes, flags, hashes))
544 > EOF
544 > EOF
545
545
546 $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \
546 $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \
547 > repo10; do
547 > repo10; do
548 > echo 'repo:' $i
548 > echo 'repo:' $i
549 > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q
549 > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q
550 > done
550 > done
551 repo: client
551 repo: client
552 repo: client2
552 repo: client2
553 repo: server
553 repo: server
554 repo: repo3
554 repo: repo3
555 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
555 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
556 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
556 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
557 repo: repo4
557 repo: repo4
558 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
558 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
559 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
559 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
560 repo: repo5
560 repo: repo5
561 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
561 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
562 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
562 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
563 repo: repo6
563 repo: repo6
564 repo: repo7
564 repo: repo7
565 repo: repo8
565 repo: repo8
566 repo: repo9
566 repo: repo9
567 repo: repo10
567 repo: repo10
568
568
569 TODO: repo12 doesn't have any cached lfs files. Figure out how to get the
570 unpushed files from repo12's source instead of the remote store, where they
571 don't exist.
572
573 $ find $TESTTMP/repo12/.hg/store/lfs/objects -type f
574 find: */repo12/.hg/store/lfs/objects': $ENOENT$ (glob)
575 [1]
576
577 $ hg --config extensions.share= share repo12 repo13
578 updating working directory
579 abort: $TESTTMP/dummy-remote/09/66faba9a01f6c78082aa45899a4fef732002d0b26404e90093adf1e876ab8d: $ENOTDIR$ (glob)
580 [255]
581 $ hg clone repo12 repo14
582 updating to branch default
583 abort: $TESTTMP/dummy-remote/09/66faba9a01f6c78082aa45899a4fef732002d0b26404e90093adf1e876ab8d: $ENOTDIR$ (glob)
584 [255]
585
586 TODO: If the source repo doesn't have the blob (maybe it was pulled or cloned
587 with --noupdate), the blob should be accessible via the global cache to send to
588 the remote store.
589
590 $ rm -rf $TESTTMP/repo14/.hg/store/lfs
591 $ hg init repo15
592 $ hg -R repo14 push repo15
593 pushing to repo15
594 searching for changes
595 abort: $TESTTMP/repo14/.hg/store/lfs/objects/1c/896a0adcf9262119f4a98216aaa5ca00a58b9a0ce848914a02f9cd876f65a3: $ENOTDIR$ (glob)
596 [255]
597
569 lfs -> normal -> lfs round trip conversions are possible. The threshold for the
598 lfs -> normal -> lfs round trip conversions are possible. The threshold for the
570 lfs destination is specified here because it was originally listed in the local
599 lfs destination is specified here because it was originally listed in the local
571 .hgrc, and the global one is too high to trigger lfs usage. For lfs -> normal,
600 .hgrc, and the global one is too high to trigger lfs usage. For lfs -> normal,
572 there's no 'lfs' destination repo requirement. For normal -> lfs, there is.
601 there's no 'lfs' destination repo requirement. For normal -> lfs, there is.
573
602
574 XXX: There's not a great way to ensure that the conversion to normal files
603 XXX: There's not a great way to ensure that the conversion to normal files
575 actually converts _everything_ to normal. The extension needs to be loaded for
604 actually converts _everything_ to normal. The extension needs to be loaded for
576 the source, but there's no way to disable it for the destination. The best that
605 the source, but there's no way to disable it for the destination. The best that
577 can be done is to raise the threshold so that lfs isn't used on the destination.
606 can be done is to raise the threshold so that lfs isn't used on the destination.
578 It doesn't like using '!' to unset the value on the command line.
607 It doesn't like using '!' to unset the value on the command line.
579
608
580 $ hg --config extensions.convert= --config lfs.threshold=1000M \
609 $ hg --config extensions.convert= --config lfs.threshold=1000M \
581 > convert repo8 convert_normal
610 > convert repo8 convert_normal
582 initializing destination convert_normal repository
611 initializing destination convert_normal repository
583 scanning source...
612 scanning source...
584 sorting...
613 sorting...
585 converting...
614 converting...
586 2 a
615 2 a
587 1 b
616 1 b
588 0 meta
617 0 meta
589 $ grep 'lfs' convert_normal/.hg/requires
618 $ grep 'lfs' convert_normal/.hg/requires
590 [1]
619 [1]
591 $ hg --cwd convert_normal debugdata a1 0
620 $ hg --cwd convert_normal debugdata a1 0
592 THIS-IS-LFS-BECAUSE-10-BYTES
621 THIS-IS-LFS-BECAUSE-10-BYTES
593
622
594 $ hg --config extensions.convert= --config lfs.threshold=10B \
623 $ hg --config extensions.convert= --config lfs.threshold=10B \
595 > convert convert_normal convert_lfs
624 > convert convert_normal convert_lfs
596 initializing destination convert_lfs repository
625 initializing destination convert_lfs repository
597 scanning source...
626 scanning source...
598 sorting...
627 sorting...
599 converting...
628 converting...
600 2 a
629 2 a
601 1 b
630 1 b
602 0 meta
631 0 meta
603 $ hg --cwd convert_lfs debugdata a1 0
632 $ hg --cwd convert_lfs debugdata a1 0
604 version https://git-lfs.github.com/spec/v1
633 version https://git-lfs.github.com/spec/v1
605 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
634 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
606 size 29
635 size 29
607 x-is-binary 0
636 x-is-binary 0
608 $ grep 'lfs' convert_lfs/.hg/requires
637 $ grep 'lfs' convert_lfs/.hg/requires
609 lfs
638 lfs
610
639
611 This convert is trickier, because it contains deleted files (via `hg mv`)
640 This convert is trickier, because it contains deleted files (via `hg mv`)
612
641
613 $ hg --config extensions.convert= --config lfs.threshold=1000M \
642 $ hg --config extensions.convert= --config lfs.threshold=1000M \
614 > convert repo3 convert_normal2
643 > convert repo3 convert_normal2
615 initializing destination convert_normal2 repository
644 initializing destination convert_normal2 repository
616 scanning source...
645 scanning source...
617 sorting...
646 sorting...
618 converting...
647 converting...
619 4 commit with lfs content
648 4 commit with lfs content
620 3 renames
649 3 renames
621 2 large to small, small to large
650 2 large to small, small to large
622 1 random modifications
651 1 random modifications
623 0 switch large and small again
652 0 switch large and small again
624 $ grep 'lfs' convert_normal2/.hg/requires
653 $ grep 'lfs' convert_normal2/.hg/requires
625 [1]
654 [1]
626 $ hg --cwd convert_normal2 debugdata large 0
655 $ hg --cwd convert_normal2 debugdata large 0
627 LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS
656 LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS
628
657
629 $ hg --config extensions.convert= --config lfs.threshold=10B \
658 $ hg --config extensions.convert= --config lfs.threshold=10B \
630 > convert convert_normal2 convert_lfs2
659 > convert convert_normal2 convert_lfs2
631 initializing destination convert_lfs2 repository
660 initializing destination convert_lfs2 repository
632 scanning source...
661 scanning source...
633 sorting...
662 sorting...
634 converting...
663 converting...
635 4 commit with lfs content
664 4 commit with lfs content
636 3 renames
665 3 renames
637 2 large to small, small to large
666 2 large to small, small to large
638 1 random modifications
667 1 random modifications
639 0 switch large and small again
668 0 switch large and small again
640 $ grep 'lfs' convert_lfs2/.hg/requires
669 $ grep 'lfs' convert_lfs2/.hg/requires
641 lfs
670 lfs
642 $ hg --cwd convert_lfs2 debugdata large 0
671 $ hg --cwd convert_lfs2 debugdata large 0
643 version https://git-lfs.github.com/spec/v1
672 version https://git-lfs.github.com/spec/v1
644 oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
673 oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
645 size 39
674 size 39
646 x-is-binary 0
675 x-is-binary 0
647
676
648 $ hg -R convert_lfs2 config --debug extensions | grep lfs
677 $ hg -R convert_lfs2 config --debug extensions | grep lfs
649 $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob)
678 $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob)
General Comments 0
You need to be logged in to leave comments. Login now