mercurial/util.py
changeset 2220 6d3cc2a982f3
parent 2193 fb28ce04b349
child 2237 4a069064a39b
--- 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