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
+++ 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)