Mercurial temporary file nomenclature
Benoit Boissinot
bboissin at gmail.com
Mon Apr 12 15:30:06 CDT 2010
On Mon, Apr 12, 2010 at 10:25:37PM +0200, Jason Harris wrote:
> Wow! That appears to work! I can change the code to then simply
>
> fh, fn = tempfile.mkstemp(prefix='hg-check-exec-')
>
> To ensure this temp file is then generated outside the tree in the
> default temp file location... Is there anything bad about that then?
> It looks from the intent of this code that you want to check the
> executable bit, maybe we could locate the temporary file in the parent
> directory then? Ie:
>
> fh, fn = tempfile.mkstemp(dir= os.path.dirname(path), prefix='hg-check-exec-')
>
> Or failing that then a specific file inside a folder inside the .hg
> directory and then FSEventStream (and I am guessing other tools) can
> ignore that directory. FSEventStream only works on directories and not
> on files.
>
> Thus it could be:
> fh, fn = tempfile.mkstemp(dir= os.path.join(path,".hg","temporaryFileDirectory"), prefix='hg-check-exec-')
>
> and clients could then ignore
> <repository-path>/.hg/temporaryFileDirectory/
It's really supposed to check the exec bit of the current dir. So I
don't think you should use any other tempdir.
regards,
Benoit
--
:wq
More information about the Mercurial
mailing list