--- a/mercurial/util.py Wed Nov 09 12:52:05 2005 -0800 +++ b/mercurial/util.py Wed Nov 09 13:38:46 2005 -0800 @@ -387,6 +387,8 @@ except: pass raise fp.close() + st = os.lstat(f) + os.chmod(temp, st.st_mode) rename(temp, f) return file(f, mode)