Mercurial > hg
comparison tests/test-largefiles-small-disk.t @ 31207:1ef37b16b8e8
dirstate: try to use hardlink to backup dirstate
This should be more efficient once util.copyfile has real hardlink support.
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 01 Mar 2017 17:59:21 -0800 |
parents | 7356e6b1f5b8 |
children | 991134261057 |
comparison
equal
deleted
inserted
replaced
31206:49e5491ed9bd | 31207:1ef37b16b8e8 |
---|---|
3 $ cat > criple.py <<EOF | 3 $ cat > criple.py <<EOF |
4 > import os, errno, shutil | 4 > import os, errno, shutil |
5 > from mercurial import util | 5 > from mercurial import util |
6 > # | 6 > # |
7 > # this makes the original largefiles code abort: | 7 > # this makes the original largefiles code abort: |
8 > _origcopyfileobj = shutil.copyfileobj | |
8 > def copyfileobj(fsrc, fdst, length=16*1024): | 9 > def copyfileobj(fsrc, fdst, length=16*1024): |
10 > # allow journal files (used by transaction) to be written | |
11 > if 'journal.' in fdst.name: | |
12 > return _origcopyfileobj(fsrc, fdst, length) | |
9 > fdst.write(fsrc.read(4)) | 13 > fdst.write(fsrc.read(4)) |
10 > raise IOError(errno.ENOSPC, os.strerror(errno.ENOSPC)) | 14 > raise IOError(errno.ENOSPC, os.strerror(errno.ENOSPC)) |
11 > shutil.copyfileobj = copyfileobj | 15 > shutil.copyfileobj = copyfileobj |
12 > # | 16 > # |
13 > # this makes the rewritten code abort: | 17 > # this makes the rewritten code abort: |