# HG changeset patch # User Vadim Gelfer # Date 1147101656 25200 # Node ID 6d3cc2a982f3e2b009894caf8f6ecf74aab60d45 # Parent ec82cff7d2c4731f46a8ec5467d1136503bef0d2 add filename to IOError if read of file fails. if file replaced with directory or symlink, IOError not fully filled out. diff -r ec82cff7d2c4 -r 6d3cc2a982f3 mercurial/util.py --- a/mercurial/util.py Mon May 08 08:04:46 2006 -0700 +++ b/mercurial/util.py Mon May 08 08:20:56 2006 -0700 @@ -687,7 +687,13 @@ os.close(fd) fp = posixfile(temp, "wb") try: - fp.write(posixfile(name, "rb").read()) + try: + s = posixfile(name, "rb").read() + except IOError, inst: + if not getattr(inst, 'filename', None): + inst.filename = name + raise + fp.write(s) except: try: os.unlink(temp) except: pass