Mercurial > hg
comparison hgext/patchbomb.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 | 258e3a7955b8 |
children | 564034552f7f |
comparison
equal
deleted
inserted
replaced
2164:cbd458228a96 | 2165:d821918e3bee |
---|---|
60 # present on windows | 60 # present on windows |
61 import readline | 61 import readline |
62 except ImportError: pass | 62 except ImportError: pass |
63 | 63 |
64 def diffstat(patch): | 64 def diffstat(patch): |
65 fd, name = tempfile.mkstemp() | 65 fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt") |
66 try: | 66 try: |
67 p = popen2.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name) | 67 p = popen2.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name) |
68 try: | 68 try: |
69 for line in patch: print >> p.tochild, line | 69 for line in patch: print >> p.tochild, line |
70 p.tochild.close() | 70 p.tochild.close() |