##// END OF EJS Templates
largefiles: add tests for summary/outgoing improved in subsequent patches...
FUJIWARA Katsunori -
r21881:6f332778 default
parent child Browse files
Show More
@@ -1,696 +1,754 b''
1 This file contains testcases that tend to be related to special cases or less
1 This file contains testcases that tend to be related to special cases or less
2 common commands affecting largefile.
2 common commands affecting largefile.
3
3
4 Each sections should be independent of each others.
4 Each sections should be independent of each others.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24
24
25
25
26 Test copies and moves from a directory other than root (issue3516)
26 Test copies and moves from a directory other than root (issue3516)
27 =========================================================================
27 =========================================================================
28
28
29 $ hg init lf_cpmv
29 $ hg init lf_cpmv
30 $ cd lf_cpmv
30 $ cd lf_cpmv
31 $ mkdir dira
31 $ mkdir dira
32 $ mkdir dira/dirb
32 $ mkdir dira/dirb
33 $ touch dira/dirb/largefile
33 $ touch dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
35 $ hg commit -m "added"
35 $ hg commit -m "added"
36 Invoking status precommit hook
36 Invoking status precommit hook
37 A dira/dirb/largefile
37 A dira/dirb/largefile
38 $ cd dira
38 $ cd dira
39 $ hg cp dirb/largefile foo/largefile
39 $ hg cp dirb/largefile foo/largefile
40 $ hg ci -m "deep copy"
40 $ hg ci -m "deep copy"
41 Invoking status precommit hook
41 Invoking status precommit hook
42 A dira/foo/largefile
42 A dira/foo/largefile
43 $ find . | sort
43 $ find . | sort
44 .
44 .
45 ./dirb
45 ./dirb
46 ./dirb/largefile
46 ./dirb/largefile
47 ./foo
47 ./foo
48 ./foo/largefile
48 ./foo/largefile
49 $ hg mv foo/largefile baz/largefile
49 $ hg mv foo/largefile baz/largefile
50 $ hg ci -m "moved"
50 $ hg ci -m "moved"
51 Invoking status precommit hook
51 Invoking status precommit hook
52 A dira/baz/largefile
52 A dira/baz/largefile
53 R dira/foo/largefile
53 R dira/foo/largefile
54 $ find . | sort
54 $ find . | sort
55 .
55 .
56 ./baz
56 ./baz
57 ./baz/largefile
57 ./baz/largefile
58 ./dirb
58 ./dirb
59 ./dirb/largefile
59 ./dirb/largefile
60 $ cd ..
60 $ cd ..
61 $ hg mv dira dirc
61 $ hg mv dira dirc
62 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
62 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
63 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
63 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
64 $ find * | sort
64 $ find * | sort
65 dirc
65 dirc
66 dirc/baz
66 dirc/baz
67 dirc/baz/largefile
67 dirc/baz/largefile
68 dirc/dirb
68 dirc/dirb
69 dirc/dirb/largefile
69 dirc/dirb/largefile
70 $ hg up -qC
70 $ hg up -qC
71 $ cd ..
71 $ cd ..
72
72
73 Clone a local repository owned by another user
73 Clone a local repository owned by another user
74 ===================================================
74 ===================================================
75
75
76 #if unix-permissions
76 #if unix-permissions
77
77
78 We have to simulate that here by setting $HOME and removing write permissions
78 We have to simulate that here by setting $HOME and removing write permissions
79 $ ORIGHOME="$HOME"
79 $ ORIGHOME="$HOME"
80 $ mkdir alice
80 $ mkdir alice
81 $ HOME="`pwd`/alice"
81 $ HOME="`pwd`/alice"
82 $ cd alice
82 $ cd alice
83 $ hg init pubrepo
83 $ hg init pubrepo
84 $ cd pubrepo
84 $ cd pubrepo
85 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
85 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
86 $ hg add --large a-large-file
86 $ hg add --large a-large-file
87 $ hg commit -m "Add a large file"
87 $ hg commit -m "Add a large file"
88 Invoking status precommit hook
88 Invoking status precommit hook
89 A a-large-file
89 A a-large-file
90 $ cd ..
90 $ cd ..
91 $ chmod -R a-w pubrepo
91 $ chmod -R a-w pubrepo
92 $ cd ..
92 $ cd ..
93 $ mkdir bob
93 $ mkdir bob
94 $ HOME="`pwd`/bob"
94 $ HOME="`pwd`/bob"
95 $ cd bob
95 $ cd bob
96 $ hg clone --pull ../alice/pubrepo pubrepo
96 $ hg clone --pull ../alice/pubrepo pubrepo
97 requesting all changes
97 requesting all changes
98 adding changesets
98 adding changesets
99 adding manifests
99 adding manifests
100 adding file changes
100 adding file changes
101 added 1 changesets with 1 changes to 1 files
101 added 1 changesets with 1 changes to 1 files
102 updating to branch default
102 updating to branch default
103 getting changed largefiles
103 getting changed largefiles
104 1 largefiles updated, 0 removed
104 1 largefiles updated, 0 removed
105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 $ cd ..
106 $ cd ..
107 $ chmod -R u+w alice/pubrepo
107 $ chmod -R u+w alice/pubrepo
108 $ HOME="$ORIGHOME"
108 $ HOME="$ORIGHOME"
109
109
110 #endif
110 #endif
111
111
112
112
113 Symlink to a large largefile should behave the same as a symlink to a normal file
113 Symlink to a large largefile should behave the same as a symlink to a normal file
114 =====================================================================================
114 =====================================================================================
115
115
116 #if symlink
116 #if symlink
117
117
118 $ hg init largesymlink
118 $ hg init largesymlink
119 $ cd largesymlink
119 $ cd largesymlink
120 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
120 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
121 $ hg add --large largefile
121 $ hg add --large largefile
122 $ hg commit -m "commit a large file"
122 $ hg commit -m "commit a large file"
123 Invoking status precommit hook
123 Invoking status precommit hook
124 A largefile
124 A largefile
125 $ ln -s largefile largelink
125 $ ln -s largefile largelink
126 $ hg add largelink
126 $ hg add largelink
127 $ hg commit -m "commit a large symlink"
127 $ hg commit -m "commit a large symlink"
128 Invoking status precommit hook
128 Invoking status precommit hook
129 A largelink
129 A largelink
130 $ rm -f largelink
130 $ rm -f largelink
131 $ hg up >/dev/null
131 $ hg up >/dev/null
132 $ test -f largelink
132 $ test -f largelink
133 [1]
133 [1]
134 $ test -L largelink
134 $ test -L largelink
135 [1]
135 [1]
136 $ rm -f largelink # make next part of the test independent of the previous
136 $ rm -f largelink # make next part of the test independent of the previous
137 $ hg up -C >/dev/null
137 $ hg up -C >/dev/null
138 $ test -f largelink
138 $ test -f largelink
139 $ test -L largelink
139 $ test -L largelink
140 $ cd ..
140 $ cd ..
141
141
142 #endif
142 #endif
143
143
144
144
145 test for pattern matching on 'hg status':
145 test for pattern matching on 'hg status':
146 ==============================================
146 ==============================================
147
147
148
148
149 to boost performance, largefiles checks whether specified patterns are
149 to boost performance, largefiles checks whether specified patterns are
150 related to largefiles in working directory (NOT to STANDIN) or not.
150 related to largefiles in working directory (NOT to STANDIN) or not.
151
151
152 $ hg init statusmatch
152 $ hg init statusmatch
153 $ cd statusmatch
153 $ cd statusmatch
154
154
155 $ mkdir -p a/b/c/d
155 $ mkdir -p a/b/c/d
156 $ echo normal > a/b/c/d/e.normal.txt
156 $ echo normal > a/b/c/d/e.normal.txt
157 $ hg add a/b/c/d/e.normal.txt
157 $ hg add a/b/c/d/e.normal.txt
158 $ echo large > a/b/c/d/e.large.txt
158 $ echo large > a/b/c/d/e.large.txt
159 $ hg add --large a/b/c/d/e.large.txt
159 $ hg add --large a/b/c/d/e.large.txt
160 $ mkdir -p a/b/c/x
160 $ mkdir -p a/b/c/x
161 $ echo normal > a/b/c/x/y.normal.txt
161 $ echo normal > a/b/c/x/y.normal.txt
162 $ hg add a/b/c/x/y.normal.txt
162 $ hg add a/b/c/x/y.normal.txt
163 $ hg commit -m 'add files'
163 $ hg commit -m 'add files'
164 Invoking status precommit hook
164 Invoking status precommit hook
165 A a/b/c/d/e.large.txt
165 A a/b/c/d/e.large.txt
166 A a/b/c/d/e.normal.txt
166 A a/b/c/d/e.normal.txt
167 A a/b/c/x/y.normal.txt
167 A a/b/c/x/y.normal.txt
168
168
169 (1) no pattern: no performance boost
169 (1) no pattern: no performance boost
170 $ hg status -A
170 $ hg status -A
171 C a/b/c/d/e.large.txt
171 C a/b/c/d/e.large.txt
172 C a/b/c/d/e.normal.txt
172 C a/b/c/d/e.normal.txt
173 C a/b/c/x/y.normal.txt
173 C a/b/c/x/y.normal.txt
174
174
175 (2) pattern not related to largefiles: performance boost
175 (2) pattern not related to largefiles: performance boost
176 $ hg status -A a/b/c/x
176 $ hg status -A a/b/c/x
177 C a/b/c/x/y.normal.txt
177 C a/b/c/x/y.normal.txt
178
178
179 (3) pattern related to largefiles: no performance boost
179 (3) pattern related to largefiles: no performance boost
180 $ hg status -A a/b/c/d
180 $ hg status -A a/b/c/d
181 C a/b/c/d/e.large.txt
181 C a/b/c/d/e.large.txt
182 C a/b/c/d/e.normal.txt
182 C a/b/c/d/e.normal.txt
183
183
184 (4) pattern related to STANDIN (not to largefiles): performance boost
184 (4) pattern related to STANDIN (not to largefiles): performance boost
185 $ hg status -A .hglf/a
185 $ hg status -A .hglf/a
186 C .hglf/a/b/c/d/e.large.txt
186 C .hglf/a/b/c/d/e.large.txt
187
187
188 (5) mixed case: no performance boost
188 (5) mixed case: no performance boost
189 $ hg status -A a/b/c/x a/b/c/d
189 $ hg status -A a/b/c/x a/b/c/d
190 C a/b/c/d/e.large.txt
190 C a/b/c/d/e.large.txt
191 C a/b/c/d/e.normal.txt
191 C a/b/c/d/e.normal.txt
192 C a/b/c/x/y.normal.txt
192 C a/b/c/x/y.normal.txt
193
193
194 verify that largefiles doesn't break filesets
194 verify that largefiles doesn't break filesets
195
195
196 $ hg log --rev . --exclude "set:binary()"
196 $ hg log --rev . --exclude "set:binary()"
197 changeset: 0:41bd42f10efa
197 changeset: 0:41bd42f10efa
198 tag: tip
198 tag: tip
199 user: test
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
200 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: add files
201 summary: add files
202
202
203 verify that large files in subrepos handled properly
203 verify that large files in subrepos handled properly
204 $ hg init subrepo
204 $ hg init subrepo
205 $ echo "subrepo = subrepo" > .hgsub
205 $ echo "subrepo = subrepo" > .hgsub
206 $ hg add .hgsub
206 $ hg add .hgsub
207 $ hg ci -m "add subrepo"
207 $ hg ci -m "add subrepo"
208 Invoking status precommit hook
208 Invoking status precommit hook
209 A .hgsub
209 A .hgsub
210 ? .hgsubstate
210 ? .hgsubstate
211 $ echo "rev 1" > subrepo/large.txt
211 $ echo "rev 1" > subrepo/large.txt
212 $ hg -R subrepo add --large subrepo/large.txt
212 $ hg -R subrepo add --large subrepo/large.txt
213 $ hg sum
213 $ hg sum
214 parent: 1:8ee150ea2e9c tip
214 parent: 1:8ee150ea2e9c tip
215 add subrepo
215 add subrepo
216 branch: default
216 branch: default
217 commit: 1 subrepos
217 commit: 1 subrepos
218 update: (current)
218 update: (current)
219 $ hg st
219 $ hg st
220 $ hg st -S
220 $ hg st -S
221 A subrepo/large.txt
221 A subrepo/large.txt
222 $ hg ci -S -m "commit top repo"
222 $ hg ci -S -m "commit top repo"
223 committing subrepository subrepo
223 committing subrepository subrepo
224 Invoking status precommit hook
224 Invoking status precommit hook
225 A large.txt
225 A large.txt
226 Invoking status precommit hook
226 Invoking status precommit hook
227 M .hgsubstate
227 M .hgsubstate
228 # No differences
228 # No differences
229 $ hg st -S
229 $ hg st -S
230 $ hg sum
230 $ hg sum
231 parent: 2:ce4cd0c527a6 tip
231 parent: 2:ce4cd0c527a6 tip
232 commit top repo
232 commit top repo
233 branch: default
233 branch: default
234 commit: (clean)
234 commit: (clean)
235 update: (current)
235 update: (current)
236 $ echo "rev 2" > subrepo/large.txt
236 $ echo "rev 2" > subrepo/large.txt
237 $ hg st -S
237 $ hg st -S
238 M subrepo/large.txt
238 M subrepo/large.txt
239 $ hg sum
239 $ hg sum
240 parent: 2:ce4cd0c527a6 tip
240 parent: 2:ce4cd0c527a6 tip
241 commit top repo
241 commit top repo
242 branch: default
242 branch: default
243 commit: 1 subrepos
243 commit: 1 subrepos
244 update: (current)
244 update: (current)
245 $ hg ci -m "this commit should fail without -S"
245 $ hg ci -m "this commit should fail without -S"
246 abort: uncommitted changes in subrepo subrepo
246 abort: uncommitted changes in subrepo subrepo
247 (use --subrepos for recursive commit)
247 (use --subrepos for recursive commit)
248 [255]
248 [255]
249
249
250 Add a normal file to the subrepo, then test archiving
250 Add a normal file to the subrepo, then test archiving
251
251
252 $ echo 'normal file' > subrepo/normal.txt
252 $ echo 'normal file' > subrepo/normal.txt
253 $ hg -R subrepo add subrepo/normal.txt
253 $ hg -R subrepo add subrepo/normal.txt
254
254
255 Lock in subrepo, otherwise the change isn't archived
255 Lock in subrepo, otherwise the change isn't archived
256
256
257 $ hg ci -S -m "add normal file to top level"
257 $ hg ci -S -m "add normal file to top level"
258 committing subrepository subrepo
258 committing subrepository subrepo
259 Invoking status precommit hook
259 Invoking status precommit hook
260 M large.txt
260 M large.txt
261 A normal.txt
261 A normal.txt
262 Invoking status precommit hook
262 Invoking status precommit hook
263 M .hgsubstate
263 M .hgsubstate
264 $ hg archive -S ../lf_subrepo_archive
264 $ hg archive -S ../lf_subrepo_archive
265 $ find ../lf_subrepo_archive | sort
265 $ find ../lf_subrepo_archive | sort
266 ../lf_subrepo_archive
266 ../lf_subrepo_archive
267 ../lf_subrepo_archive/.hg_archival.txt
267 ../lf_subrepo_archive/.hg_archival.txt
268 ../lf_subrepo_archive/.hgsub
268 ../lf_subrepo_archive/.hgsub
269 ../lf_subrepo_archive/.hgsubstate
269 ../lf_subrepo_archive/.hgsubstate
270 ../lf_subrepo_archive/a
270 ../lf_subrepo_archive/a
271 ../lf_subrepo_archive/a/b
271 ../lf_subrepo_archive/a/b
272 ../lf_subrepo_archive/a/b/c
272 ../lf_subrepo_archive/a/b/c
273 ../lf_subrepo_archive/a/b/c/d
273 ../lf_subrepo_archive/a/b/c/d
274 ../lf_subrepo_archive/a/b/c/d/e.large.txt
274 ../lf_subrepo_archive/a/b/c/d/e.large.txt
275 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
275 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
276 ../lf_subrepo_archive/a/b/c/x
276 ../lf_subrepo_archive/a/b/c/x
277 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
277 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
278 ../lf_subrepo_archive/subrepo
278 ../lf_subrepo_archive/subrepo
279 ../lf_subrepo_archive/subrepo/large.txt
279 ../lf_subrepo_archive/subrepo/large.txt
280 ../lf_subrepo_archive/subrepo/normal.txt
280 ../lf_subrepo_archive/subrepo/normal.txt
281
281
282 Test update with subrepos.
282 Test update with subrepos.
283
283
284 $ hg update 0
284 $ hg update 0
285 getting changed largefiles
285 getting changed largefiles
286 0 largefiles updated, 1 removed
286 0 largefiles updated, 1 removed
287 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
287 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
288 $ hg status -S
288 $ hg status -S
289 $ hg update tip
289 $ hg update tip
290 getting changed largefiles
290 getting changed largefiles
291 1 largefiles updated, 0 removed
291 1 largefiles updated, 0 removed
292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 $ hg status -S
293 $ hg status -S
294 # modify a large file
294 # modify a large file
295 $ echo "modified" > subrepo/large.txt
295 $ echo "modified" > subrepo/large.txt
296 $ hg st -S
296 $ hg st -S
297 M subrepo/large.txt
297 M subrepo/large.txt
298 # update -C should revert the change.
298 # update -C should revert the change.
299 $ hg update -C
299 $ hg update -C
300 getting changed largefiles
300 getting changed largefiles
301 1 largefiles updated, 0 removed
301 1 largefiles updated, 0 removed
302 getting changed largefiles
302 getting changed largefiles
303 0 largefiles updated, 0 removed
303 0 largefiles updated, 0 removed
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 $ hg status -S
305 $ hg status -S
306
306
307 Test archiving a revision that references a subrepo that is not yet
307 Test archiving a revision that references a subrepo that is not yet
308 cloned (see test-subrepo-recursion.t):
308 cloned (see test-subrepo-recursion.t):
309
309
310 $ hg clone -U . ../empty
310 $ hg clone -U . ../empty
311 $ cd ../empty
311 $ cd ../empty
312 $ hg archive --subrepos -r tip ../archive.tar.gz
312 $ hg archive --subrepos -r tip ../archive.tar.gz
313 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
313 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
314 $ cd ..
314 $ cd ..
315
315
316
316
317
317
318
318
319
319
320
320
321 Test addremove, forget and others
321 Test addremove, forget and others
322 ==============================================
322 ==============================================
323
323
324 Test that addremove picks up largefiles prior to the initial commit (issue3541)
324 Test that addremove picks up largefiles prior to the initial commit (issue3541)
325
325
326 $ hg init addrm2
326 $ hg init addrm2
327 $ cd addrm2
327 $ cd addrm2
328 $ touch large.dat
328 $ touch large.dat
329 $ touch large2.dat
329 $ touch large2.dat
330 $ touch normal
330 $ touch normal
331 $ hg add --large large.dat
331 $ hg add --large large.dat
332 $ hg addremove -v
332 $ hg addremove -v
333 adding large2.dat as a largefile
333 adding large2.dat as a largefile
334 adding normal
334 adding normal
335
335
336 Test that forgetting all largefiles reverts to islfilesrepo() == False
336 Test that forgetting all largefiles reverts to islfilesrepo() == False
337 (addremove will add *.dat as normal files now)
337 (addremove will add *.dat as normal files now)
338 $ hg forget large.dat
338 $ hg forget large.dat
339 $ hg forget large2.dat
339 $ hg forget large2.dat
340 $ hg addremove -v
340 $ hg addremove -v
341 adding large.dat
341 adding large.dat
342 adding large2.dat
342 adding large2.dat
343
343
344 Test commit's addremove option prior to the first commit
344 Test commit's addremove option prior to the first commit
345 $ hg forget large.dat
345 $ hg forget large.dat
346 $ hg forget large2.dat
346 $ hg forget large2.dat
347 $ hg add --large large.dat
347 $ hg add --large large.dat
348 $ hg ci -Am "commit"
348 $ hg ci -Am "commit"
349 adding large2.dat as a largefile
349 adding large2.dat as a largefile
350 Invoking status precommit hook
350 Invoking status precommit hook
351 A large.dat
351 A large.dat
352 A large2.dat
352 A large2.dat
353 A normal
353 A normal
354 $ find .hglf | sort
354 $ find .hglf | sort
355 .hglf
355 .hglf
356 .hglf/large.dat
356 .hglf/large.dat
357 .hglf/large2.dat
357 .hglf/large2.dat
358
358
359 Test actions on largefiles using relative paths from subdir
359 Test actions on largefiles using relative paths from subdir
360
360
361 $ mkdir sub
361 $ mkdir sub
362 $ cd sub
362 $ cd sub
363 $ echo anotherlarge > anotherlarge
363 $ echo anotherlarge > anotherlarge
364 $ hg add --large anotherlarge
364 $ hg add --large anotherlarge
365 $ hg st
365 $ hg st
366 A sub/anotherlarge
366 A sub/anotherlarge
367 $ hg st anotherlarge
367 $ hg st anotherlarge
368 A anotherlarge
368 A anotherlarge
369 $ hg commit -m anotherlarge anotherlarge
369 $ hg commit -m anotherlarge anotherlarge
370 Invoking status precommit hook
370 Invoking status precommit hook
371 A sub/anotherlarge
371 A sub/anotherlarge
372 $ hg log anotherlarge
372 $ hg log anotherlarge
373 changeset: 1:9627a577c5e9
373 changeset: 1:9627a577c5e9
374 tag: tip
374 tag: tip
375 user: test
375 user: test
376 date: Thu Jan 01 00:00:00 1970 +0000
376 date: Thu Jan 01 00:00:00 1970 +0000
377 summary: anotherlarge
377 summary: anotherlarge
378
378
379 $ hg log -G anotherlarge
379 $ hg log -G anotherlarge
380 @ changeset: 1:9627a577c5e9
380 @ changeset: 1:9627a577c5e9
381 | tag: tip
381 | tag: tip
382 | user: test
382 | user: test
383 | date: Thu Jan 01 00:00:00 1970 +0000
383 | date: Thu Jan 01 00:00:00 1970 +0000
384 | summary: anotherlarge
384 | summary: anotherlarge
385 |
385 |
386 $ echo more >> anotherlarge
386 $ echo more >> anotherlarge
387 $ hg st .
387 $ hg st .
388 M anotherlarge
388 M anotherlarge
389 $ hg cat anotherlarge
389 $ hg cat anotherlarge
390 anotherlarge
390 anotherlarge
391 $ hg revert anotherlarge
391 $ hg revert anotherlarge
392 $ hg st
392 $ hg st
393 ? sub/anotherlarge.orig
393 ? sub/anotherlarge.orig
394 $ cd ..
394 $ cd ..
395
395
396 $ cd ..
396 $ cd ..
397
397
398 Check error message while exchange
398 Check error message while exchange
399 =========================================================
399 =========================================================
400
400
401 issue3651: summary/outgoing with largefiles shows "no remote repo"
401 issue3651: summary/outgoing with largefiles shows "no remote repo"
402 unexpectedly
402 unexpectedly
403
403
404 $ mkdir issue3651
404 $ mkdir issue3651
405 $ cd issue3651
405 $ cd issue3651
406
406
407 $ hg init src
407 $ hg init src
408 $ echo a > src/a
408 $ echo a > src/a
409 $ hg -R src add --large src/a
409 $ hg -R src add --large src/a
410 $ hg -R src commit -m '#0'
410 $ hg -R src commit -m '#0'
411 Invoking status precommit hook
411 Invoking status precommit hook
412 A a
412 A a
413
413
414 check messages when no remote repository is specified:
414 check messages when no remote repository is specified:
415 "no remote repo" route for "hg outgoing --large" is not tested here,
415 "no remote repo" route for "hg outgoing --large" is not tested here,
416 because it can't be reproduced easily.
416 because it can't be reproduced easily.
417
417
418 $ hg init clone1
418 $ hg init clone1
419 $ hg -R clone1 -q pull src
419 $ hg -R clone1 -q pull src
420 $ hg -R clone1 -q update
420 $ hg -R clone1 -q update
421 $ hg -R clone1 paths | grep default
421 $ hg -R clone1 paths | grep default
422 [1]
422 [1]
423
423
424 $ hg -R clone1 summary --large
424 $ hg -R clone1 summary --large
425 parent: 0:fc0bd45326d3 tip
425 parent: 0:fc0bd45326d3 tip
426 #0
426 #0
427 branch: default
427 branch: default
428 commit: (clean)
428 commit: (clean)
429 update: (current)
429 update: (current)
430 largefiles: (no remote repo)
430 largefiles: (no remote repo)
431
431
432 check messages when there is no files to upload:
432 check messages when there is no files to upload:
433
433
434 $ hg -q clone src clone2
434 $ hg -q clone src clone2
435 $ hg -R clone2 paths | grep default
435 $ hg -R clone2 paths | grep default
436 default = $TESTTMP/issue3651/src (glob)
436 default = $TESTTMP/issue3651/src (glob)
437
437
438 $ hg -R clone2 summary --large
438 $ hg -R clone2 summary --large
439 parent: 0:fc0bd45326d3 tip
439 parent: 0:fc0bd45326d3 tip
440 #0
440 #0
441 branch: default
441 branch: default
442 commit: (clean)
442 commit: (clean)
443 update: (current)
443 update: (current)
444 largefiles: (no files to upload)
444 largefiles: (no files to upload)
445 $ hg -R clone2 outgoing --large
445 $ hg -R clone2 outgoing --large
446 comparing with $TESTTMP/issue3651/src (glob)
446 comparing with $TESTTMP/issue3651/src (glob)
447 searching for changes
447 searching for changes
448 no changes found
448 no changes found
449 largefiles: no files to upload
449 largefiles: no files to upload
450 [1]
450 [1]
451
451
452 $ hg -R clone2 outgoing --large --graph --template "{rev}"
452 $ hg -R clone2 outgoing --large --graph --template "{rev}"
453 comparing with $TESTTMP/issue3651/src (glob)
453 comparing with $TESTTMP/issue3651/src (glob)
454 searching for changes
454 searching for changes
455 no changes found
455 no changes found
456 largefiles: no files to upload
456 largefiles: no files to upload
457
457
458 check messages when there are files to upload:
458 check messages when there are files to upload:
459
459
460 $ echo b > clone2/b
460 $ echo b > clone2/b
461 $ hg -R clone2 add --large clone2/b
461 $ hg -R clone2 add --large clone2/b
462 $ hg -R clone2 commit -m '#1'
462 $ hg -R clone2 commit -m '#1'
463 Invoking status precommit hook
463 Invoking status precommit hook
464 A b
464 A b
465 $ hg -R clone2 summary --large
465 $ hg -R clone2 summary --large
466 parent: 1:1acbe71ce432 tip
466 parent: 1:1acbe71ce432 tip
467 #1
467 #1
468 branch: default
468 branch: default
469 commit: (clean)
469 commit: (clean)
470 update: (current)
470 update: (current)
471 largefiles: 1 to upload
471 largefiles: 1 to upload
472 $ hg -R clone2 outgoing --large
472 $ hg -R clone2 outgoing --large
473 comparing with $TESTTMP/issue3651/src (glob)
473 comparing with $TESTTMP/issue3651/src (glob)
474 searching for changes
474 searching for changes
475 changeset: 1:1acbe71ce432
475 changeset: 1:1acbe71ce432
476 tag: tip
476 tag: tip
477 user: test
477 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
478 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: #1
479 summary: #1
480
480
481 largefiles to upload:
481 largefiles to upload:
482 b
482 b
483
483
484 $ hg -R clone2 outgoing --large --graph --template "{rev}"
484 $ hg -R clone2 outgoing --large --graph --template "{rev}"
485 comparing with $TESTTMP/issue3651/src
485 comparing with $TESTTMP/issue3651/src
486 searching for changes
486 searching for changes
487 @ 1
487 @ 1
488
488
489 largefiles to upload:
489 largefiles to upload:
490 b
490 b
491
491
492
492
493 $ cp clone2/b clone2/b1
494 $ cp clone2/b clone2/b2
495 $ hg -R clone2 add --large clone2/b1 clone2/b2
496 $ hg -R clone2 commit -m '#2: add largefiles referring same entity'
497 Invoking status precommit hook
498 A b1
499 A b2
500 $ hg -R clone2 summary --large
501 parent: 2:6095d0695d70 tip
502 #2: add largefiles referring same entity
503 branch: default
504 commit: (clean)
505 update: (current)
506 largefiles: 3 to upload
507 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
508 comparing with $TESTTMP/issue3651/src (glob)
509 searching for changes
510 1:1acbe71ce432
511 2:6095d0695d70
512 largefiles to upload:
513 b
514 b1
515 b2
516
517
518 $ echo bbb > clone2/b
519 $ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
520 Invoking status precommit hook
521 M b
522 $ echo bbbb > clone2/b
523 $ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
524 Invoking status precommit hook
525 M b
526 $ cp clone2/b1 clone2/b
527 $ hg -R clone2 commit -m '#5: refer existing largefile entity again'
528 Invoking status precommit hook
529 M b
530 $ hg -R clone2 summary --large
531 parent: 5:036794ea641c tip
532 #5: refer existing largefile entity again
533 branch: default
534 commit: (clean)
535 update: (current)
536 largefiles: 3 to upload
537 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
538 comparing with $TESTTMP/issue3651/src (glob)
539 searching for changes
540 1:1acbe71ce432
541 2:6095d0695d70
542 3:7983dce246cc
543 4:233f12ada4ae
544 5:036794ea641c
545 largefiles to upload:
546 b
547 b1
548 b2
549
550
493 $ cd ..
551 $ cd ..
494
552
495 merge action 'd' for 'local renamed directory to d2/g' which has no filename
553 merge action 'd' for 'local renamed directory to d2/g' which has no filename
496 ==================================================================================
554 ==================================================================================
497
555
498 $ hg init merge-action
556 $ hg init merge-action
499 $ cd merge-action
557 $ cd merge-action
500 $ touch l
558 $ touch l
501 $ hg add --large l
559 $ hg add --large l
502 $ mkdir d1
560 $ mkdir d1
503 $ touch d1/f
561 $ touch d1/f
504 $ hg ci -Aqm0
562 $ hg ci -Aqm0
505 Invoking status precommit hook
563 Invoking status precommit hook
506 A d1/f
564 A d1/f
507 A l
565 A l
508 $ echo > d1/f
566 $ echo > d1/f
509 $ touch d1/g
567 $ touch d1/g
510 $ hg ci -Aqm1
568 $ hg ci -Aqm1
511 Invoking status precommit hook
569 Invoking status precommit hook
512 M d1/f
570 M d1/f
513 A d1/g
571 A d1/g
514 $ hg up -qr0
572 $ hg up -qr0
515 $ hg mv d1 d2
573 $ hg mv d1 d2
516 moving d1/f to d2/f (glob)
574 moving d1/f to d2/f (glob)
517 $ hg ci -qm2
575 $ hg ci -qm2
518 Invoking status precommit hook
576 Invoking status precommit hook
519 A d2/f
577 A d2/f
520 R d1/f
578 R d1/f
521 $ hg merge
579 $ hg merge
522 merging d2/f and d1/f to d2/f
580 merging d2/f and d1/f to d2/f
523 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
581 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
524 (branch merge, don't forget to commit)
582 (branch merge, don't forget to commit)
525 getting changed largefiles
583 getting changed largefiles
526 0 largefiles updated, 0 removed
584 0 largefiles updated, 0 removed
527 $ cd ..
585 $ cd ..
528
586
529
587
530 Merge conflicts:
588 Merge conflicts:
531 =====================
589 =====================
532
590
533 $ hg init merge
591 $ hg init merge
534 $ cd merge
592 $ cd merge
535 $ echo 0 > f-different
593 $ echo 0 > f-different
536 $ echo 0 > f-same
594 $ echo 0 > f-same
537 $ echo 0 > f-unchanged-1
595 $ echo 0 > f-unchanged-1
538 $ echo 0 > f-unchanged-2
596 $ echo 0 > f-unchanged-2
539 $ hg add --large *
597 $ hg add --large *
540 $ hg ci -m0
598 $ hg ci -m0
541 Invoking status precommit hook
599 Invoking status precommit hook
542 A f-different
600 A f-different
543 A f-same
601 A f-same
544 A f-unchanged-1
602 A f-unchanged-1
545 A f-unchanged-2
603 A f-unchanged-2
546 $ echo tmp1 > f-unchanged-1
604 $ echo tmp1 > f-unchanged-1
547 $ echo tmp1 > f-unchanged-2
605 $ echo tmp1 > f-unchanged-2
548 $ echo tmp1 > f-same
606 $ echo tmp1 > f-same
549 $ hg ci -m1
607 $ hg ci -m1
550 Invoking status precommit hook
608 Invoking status precommit hook
551 M f-same
609 M f-same
552 M f-unchanged-1
610 M f-unchanged-1
553 M f-unchanged-2
611 M f-unchanged-2
554 $ echo 2 > f-different
612 $ echo 2 > f-different
555 $ echo 0 > f-unchanged-1
613 $ echo 0 > f-unchanged-1
556 $ echo 1 > f-unchanged-2
614 $ echo 1 > f-unchanged-2
557 $ echo 1 > f-same
615 $ echo 1 > f-same
558 $ hg ci -m2
616 $ hg ci -m2
559 Invoking status precommit hook
617 Invoking status precommit hook
560 M f-different
618 M f-different
561 M f-same
619 M f-same
562 M f-unchanged-1
620 M f-unchanged-1
563 M f-unchanged-2
621 M f-unchanged-2
564 $ hg up -qr0
622 $ hg up -qr0
565 $ echo tmp2 > f-unchanged-1
623 $ echo tmp2 > f-unchanged-1
566 $ echo tmp2 > f-unchanged-2
624 $ echo tmp2 > f-unchanged-2
567 $ echo tmp2 > f-same
625 $ echo tmp2 > f-same
568 $ hg ci -m3
626 $ hg ci -m3
569 Invoking status precommit hook
627 Invoking status precommit hook
570 M f-same
628 M f-same
571 M f-unchanged-1
629 M f-unchanged-1
572 M f-unchanged-2
630 M f-unchanged-2
573 created new head
631 created new head
574 $ echo 1 > f-different
632 $ echo 1 > f-different
575 $ echo 1 > f-unchanged-1
633 $ echo 1 > f-unchanged-1
576 $ echo 0 > f-unchanged-2
634 $ echo 0 > f-unchanged-2
577 $ echo 1 > f-same
635 $ echo 1 > f-same
578 $ hg ci -m4
636 $ hg ci -m4
579 Invoking status precommit hook
637 Invoking status precommit hook
580 M f-different
638 M f-different
581 M f-same
639 M f-same
582 M f-unchanged-1
640 M f-unchanged-1
583 M f-unchanged-2
641 M f-unchanged-2
584 $ hg merge
642 $ hg merge
585 largefile f-different has a merge conflict
643 largefile f-different has a merge conflict
586 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
644 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
587 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
645 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
588 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
646 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
589 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
647 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
590 (branch merge, don't forget to commit)
648 (branch merge, don't forget to commit)
591 getting changed largefiles
649 getting changed largefiles
592 1 largefiles updated, 0 removed
650 1 largefiles updated, 0 removed
593 $ cat f-different
651 $ cat f-different
594 1
652 1
595 $ cat f-same
653 $ cat f-same
596 1
654 1
597 $ cat f-unchanged-1
655 $ cat f-unchanged-1
598 1
656 1
599 $ cat f-unchanged-2
657 $ cat f-unchanged-2
600 1
658 1
601 $ cd ..
659 $ cd ..
602
660
603 Test largefile insulation (do not enabled a side effect
661 Test largefile insulation (do not enabled a side effect
604 ========================================================
662 ========================================================
605
663
606 Check whether "largefiles" feature is supported only in repositories
664 Check whether "largefiles" feature is supported only in repositories
607 enabling largefiles extension.
665 enabling largefiles extension.
608
666
609 $ mkdir individualenabling
667 $ mkdir individualenabling
610 $ cd individualenabling
668 $ cd individualenabling
611
669
612 $ hg init enabledlocally
670 $ hg init enabledlocally
613 $ echo large > enabledlocally/large
671 $ echo large > enabledlocally/large
614 $ hg -R enabledlocally add --large enabledlocally/large
672 $ hg -R enabledlocally add --large enabledlocally/large
615 $ hg -R enabledlocally commit -m '#0'
673 $ hg -R enabledlocally commit -m '#0'
616 Invoking status precommit hook
674 Invoking status precommit hook
617 A large
675 A large
618
676
619 $ hg init notenabledlocally
677 $ hg init notenabledlocally
620 $ echo large > notenabledlocally/large
678 $ echo large > notenabledlocally/large
621 $ hg -R notenabledlocally add --large notenabledlocally/large
679 $ hg -R notenabledlocally add --large notenabledlocally/large
622 $ hg -R notenabledlocally commit -m '#0'
680 $ hg -R notenabledlocally commit -m '#0'
623 Invoking status precommit hook
681 Invoking status precommit hook
624 A large
682 A large
625
683
626 $ cat >> $HGRCPATH <<EOF
684 $ cat >> $HGRCPATH <<EOF
627 > [extensions]
685 > [extensions]
628 > # disable globally
686 > # disable globally
629 > largefiles=!
687 > largefiles=!
630 > EOF
688 > EOF
631 $ cat >> enabledlocally/.hg/hgrc <<EOF
689 $ cat >> enabledlocally/.hg/hgrc <<EOF
632 > [extensions]
690 > [extensions]
633 > # enable locally
691 > # enable locally
634 > largefiles=
692 > largefiles=
635 > EOF
693 > EOF
636 $ hg -R enabledlocally root
694 $ hg -R enabledlocally root
637 $TESTTMP/individualenabling/enabledlocally (glob)
695 $TESTTMP/individualenabling/enabledlocally (glob)
638 $ hg -R notenabledlocally root
696 $ hg -R notenabledlocally root
639 abort: repository requires features unknown to this Mercurial: largefiles!
697 abort: repository requires features unknown to this Mercurial: largefiles!
640 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
698 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
641 [255]
699 [255]
642
700
643 $ hg init push-dst
701 $ hg init push-dst
644 $ hg -R enabledlocally push push-dst
702 $ hg -R enabledlocally push push-dst
645 pushing to push-dst
703 pushing to push-dst
646 abort: required features are not supported in the destination: largefiles
704 abort: required features are not supported in the destination: largefiles
647 [255]
705 [255]
648
706
649 $ hg init pull-src
707 $ hg init pull-src
650 $ hg -R pull-src pull enabledlocally
708 $ hg -R pull-src pull enabledlocally
651 pulling from enabledlocally
709 pulling from enabledlocally
652 abort: required features are not supported in the destination: largefiles
710 abort: required features are not supported in the destination: largefiles
653 [255]
711 [255]
654
712
655 $ hg clone enabledlocally clone-dst
713 $ hg clone enabledlocally clone-dst
656 abort: repository requires features unknown to this Mercurial: largefiles!
714 abort: repository requires features unknown to this Mercurial: largefiles!
657 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
715 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
658 [255]
716 [255]
659 $ test -d clone-dst
717 $ test -d clone-dst
660 [1]
718 [1]
661 $ hg clone --pull enabledlocally clone-pull-dst
719 $ hg clone --pull enabledlocally clone-pull-dst
662 abort: required features are not supported in the destination: largefiles
720 abort: required features are not supported in the destination: largefiles
663 [255]
721 [255]
664 $ test -d clone-pull-dst
722 $ test -d clone-pull-dst
665 [1]
723 [1]
666
724
667 #if serve
725 #if serve
668
726
669 Test largefiles specific peer setup, when largefiles is enabled
727 Test largefiles specific peer setup, when largefiles is enabled
670 locally (issue4109)
728 locally (issue4109)
671
729
672 $ hg showconfig extensions | grep largefiles
730 $ hg showconfig extensions | grep largefiles
673 extensions.largefiles=!
731 extensions.largefiles=!
674 $ mkdir -p $TESTTMP/individualenabling/usercache
732 $ mkdir -p $TESTTMP/individualenabling/usercache
675
733
676 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
734 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
677 $ cat hg.pid >> $DAEMON_PIDS
735 $ cat hg.pid >> $DAEMON_PIDS
678
736
679 $ hg init pull-dst
737 $ hg init pull-dst
680 $ cat > pull-dst/.hg/hgrc <<EOF
738 $ cat > pull-dst/.hg/hgrc <<EOF
681 > [extensions]
739 > [extensions]
682 > # enable locally
740 > # enable locally
683 > largefiles=
741 > largefiles=
684 > [largefiles]
742 > [largefiles]
685 > # ignore system cache to force largefiles specific wire proto access
743 > # ignore system cache to force largefiles specific wire proto access
686 > usercache=$TESTTMP/individualenabling/usercache
744 > usercache=$TESTTMP/individualenabling/usercache
687 > EOF
745 > EOF
688 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
746 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
689
747
690 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
748 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
691 #endif
749 #endif
692
750
693 $ cd ..
751 $ cd ..
694
752
695
753
696
754
General Comments 0
You need to be logged in to leave comments. Login now