Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 2165:d821918e3bee
Use better names (hg-{usage}-{random}.{suffix}) for temporary files.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sun, 30 Apr 2006 21:11:22 +0200 |
parents | 635653cd73ab |
children | 6886bc0b77af |
line wrap: on
line diff
--- a/mercurial/util.py Sun Apr 30 19:30:59 2006 +0200 +++ b/mercurial/util.py Sun Apr 30 21:11:22 2006 +0200 @@ -46,11 +46,11 @@ the temporary files generated.''' inname, outname = None, None try: - infd, inname = tempfile.mkstemp(prefix='hgfin') + infd, inname = tempfile.mkstemp(prefix='hg-filter-in-') fp = os.fdopen(infd, 'wb') fp.write(s) fp.close() - outfd, outname = tempfile.mkstemp(prefix='hgfout') + outfd, outname = tempfile.mkstemp(prefix='hg-filter-out-') os.close(outfd) cmd = cmd.replace('INFILE', inname) cmd = cmd.replace('OUTFILE', outname) @@ -464,7 +464,7 @@ def mktempcopy(name): d, fn = os.path.split(name) - fd, temp = tempfile.mkstemp(prefix=fn, dir=d) + fd, temp = tempfile.mkstemp(prefix=".%s-" % fn, dir=d) fp = os.fdopen(fd, "wb") try: fp.write(file(name, "rb").read())