mercurial/patch.py
changeset 4316 6e4334be0aaa
parent 4229 24c22a3f2ef8
child 4325 aa26759c6fb3
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