Mercurial temporary file nomenclature

Mike Meyer mwm at mired.org
Tue Apr 13 13:44:34 CDT 2010


On Tue, 13 Apr 2010 10:58:00 -0700
Larry Hastings <larry at hastings.org> wrote:
> I had a crazy, crazy idea this morning: Mercurial should put all its 
> temporary files in its very own .hg directory.  I mean, it already /has/ 
> its own directory, and unless some jackass did something crazy it's 
> going to be on the same mount as the repository as a whole.  Mercurial 
> could even use ".hg/tmp/" if it wanted to keep its .hg directory neat 
> and tidy.

I'd say crazy is right.

/tmp is meant for temporary files. Unless some jackass did something
crazy, it should be on storage whose key criteria is speed. source
files - including hg repos - should, on the other hand, be on storage
whose primary criteria is reliability and robustness. It should be
perfectly normal to do things for the storage that an hg repo is on
that you really, really don't want to do for those temp files - like
saving multiple copies, checksumming every block on read/write, taking
snapshots at regular intervals, etc. Likewise, it should be perfectly
normal to put /tmp on storage you'd never use for real source files,
like put it on a memory disk that gets rebuilt every reboot.

> I think the temporary directory should also be specifiable as an option, 
> in case some nut runs hg on a readonly mount.  But I admit I don't have 
> that problem.

You can already set the directory to use by tweaking the environment
variable TMPDIR (or TEMP, or TMP). These will almost certainly affect
other command as well.

      <mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org


More information about the Mercurial mailing list