Tools like Buck have patterns to ignore the creation of files (in the working
copy) that match certain patterns:
When Buck sees a new source file (as reported by Watchman), it has to invalidate
a number of caches associated with the directory that contains the file.
Using a standard suffix, such as ~, would make it easier for Buck and others
to filter out these types of file creation events.
The other uses of tempfile.mkstemp() in Hg do not appear to be problematic
because they (generally speaking) do not specify the dir parameter, so the
new file is created in the system-appropriate temp directory, which is outside
the working copy.
Could you make suffix a keyword argument here, default to ~?
Therefore we can give callsite control about what extension it wants.