comparison mercurial/util.py @ 1391:9395c2f94130

Fix patch failure reporting exception
author Matt Mackall <mpm@selenic.com>
date Sat, 15 Oct 2005 15:04:45 -0700
parents 854775b27d1a
children 9a70776e355e
comparison
equal deleted inserted replaced
1390:ce95599eedac 1391:9395c2f94130
80 if line.startswith('patching file '): 80 if line.startswith('patching file '):
81 pf = parse_patch_output(line) 81 pf = parse_patch_output(line)
82 files.setdefault(pf, 1) 82 files.setdefault(pf, 1)
83 code = fp.close() 83 code = fp.close()
84 if code: 84 if code:
85 raise Abort("patch command failed: %s" % explain_exit(code)) 85 raise Abort("patch command failed: %s" % explain_exit(code)[0])
86 return files.keys() 86 return files.keys()
87 87
88 def binary(s): 88 def binary(s):
89 """return true if a string is binary data using diff's heuristic""" 89 """return true if a string is binary data using diff's heuristic"""
90 if s and '\0' in s[:4096]: 90 if s and '\0' in s[:4096]: