diff mercurial/util.py @ 1521:11a58d2cdffb

copy the mode of the file when breaking hardlinks
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 09 Nov 2005 13:38:46 -0800
parents 4d38b85e60aa
children c9f33196805b
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -387,6 +387,8 @@ def opener(base):
                         except: pass
                         raise
                     fp.close()
+                    st = os.lstat(f)
+                    os.chmod(temp, st.st_mode)
                     rename(temp, f)
 
         return file(f, mode)