copy the mode of the file when breaking hardlinks
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 09 Nov 2005 13:38:46 -0800
changeset 1521 11a58d2cdffb
parent 1519 5b19dea9d4fd
child 1522 d07d729ce306
copy the mode of the file when breaking hardlinks
mercurial/util.py
--- 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)