comparison mercurial/patch.py @ 4316:6e4334be0aaa

Try to find diffstat in PATH before calling it At least on Solaris, /bin/sh will print a "command not found" message even if we redirect stderr.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 07 Apr 2007 04:27:55 -0300
parents 24c22a3f2ef8
children aa26759c6fb3
comparison
equal deleted inserted replaced
4315:bc6f5a1d8b7b 4316:6e4334be0aaa
661 661
662 for seqno, rev in enumerate(revs): 662 for seqno, rev in enumerate(revs):
663 single(repo.lookup(rev), seqno+1, fp) 663 single(repo.lookup(rev), seqno+1, fp)
664 664
665 def diffstat(patchlines): 665 def diffstat(patchlines):
666 if not util.find_in_path('diffstat', os.environ.get('PATH', '')):
667 return
666 fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt") 668 fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt")
667 try: 669 try:
668 p = popen2.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name) 670 p = popen2.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name)
669 try: 671 try:
670 for line in patchlines: print >> p.tochild, line 672 for line in patchlines: print >> p.tochild, line