largefiles: replace tempfile.NamedTemporaryFile with tempfile.mkstemp
This is consistent with the rest of Mercurial's code, mirroring the
try-finally-unlink structure elsewhere. Furthermore, it fixes the case where
largefiles throws an IOError on Windows when the temporary file is opened a
second time by copytocacheabsolute.
This patch creates the temporary file in the repo's largefiles store rather than
/tmp, which might be a different filesystem.
util: allow sha1() with no args
Normally this works because we replace util.sha1 with hashlib.sha1
after first use, but if the first user doesn't provide an arg, it
breaks.
setup: set whole env for running hg even if .hg doesn't exist (
issue3073)
The issue was partially fixed by
b357a972d6cd, but there were missing
variables to run build_hgextindex.
keyword: backout realpath change (
issue3071)
largefiles: avoid checking requirements on every command
When largefiles is enabled, commands on large repositories which don't
require largefiles could be slowed down substantially. Disable
checking this for every command.
largefiles: fix bad bug where transplanting a changeset with a largefile will result in an old largefile being comitted later on
largefiles: test that a largefile cannot accidentally be re-added as a regular file