discovery-helper: use reflink copy if available...
discovery-helper: use reflink copy if available
A reflink copy will copy the files "as usual" but keep using the same data block
underneath. This is only supported by "copy on write" file system like btrfs or
zfs.
This will achieve similar performance that the existing hardlink clone that
Mercurial performs with the same initial space saving. However, it will behave
better on revlogs start being touch by strip. Instead of duplicating all data in
the touched revlogs, only the block actually affected by the strip will be
duplicated. This save a lot of space when building many variants of large
repositories.
The --reflink=always flag make sure the `cp` call fails if reflink copies are
not supported. Falling back to local clone.