comparison tests/test-lfs-largefiles.t @ 35104:f6f8b7c8919a

lfs: generate a large file by using `python` instead of yes | head yes(1) on some systems (like gcc112) feels compelled to inform you of broken pipes, such as those triggered by head(1). This works around the problem portably.
author Augie Fackler <augie@google.com>
date Mon, 20 Nov 2017 18:05:15 -0500
parents ec7f0bb95277
children f8f939a2926c
comparison
equal deleted inserted replaced
35103:7ea56f5700b8 35104:f6f8b7c8919a
197 When both largefiles and lfs are configured to add by size, the tie goes to 197 When both largefiles and lfs are configured to add by size, the tie goes to
198 largefiles since it hooks cmdutil.add() and lfs hooks the filelog write in the 198 largefiles since it hooks cmdutil.add() and lfs hooks the filelog write in the
199 commit. By the time the commit occurs, the tracked file is smaller than the 199 commit. By the time the commit occurs, the tracked file is smaller than the
200 threshold (assuming it is > 41, so the standins don't become lfs objects). 200 threshold (assuming it is > 41, so the standins don't become lfs objects).
201 201
202 $ yes | head -n 1048576 > large_by_size.bin 202 $ $PYTHON -c 'import sys ; sys.stdout.write("y\n" * 1048576)' > large_by_size.bin
203 $ hg --config largefiles.minsize=1 ci -Am 'large by size' 203 $ hg --config largefiles.minsize=1 ci -Am 'large by size'
204 adding large_by_size.bin as a largefile 204 adding large_by_size.bin as a largefile
205 $ hg manifest 205 $ hg manifest
206 .hglf/large.bin 206 .hglf/large.bin
207 .hglf/large_by_size.bin 207 .hglf/large_by_size.bin