Closed GoogleCodeExporter closed 8 years ago
Suggested patch:
Index: patch.py
===================================================================
--- patch.py (revision 146)
+++ patch.py (working copy)
@@ -37,7 +37,9 @@
from os.path import exists, isabs, isfile, abspath, normpath
import os
+from stat import *
+
#------------------------------------------------
# Logging is controlled by "python_patch" logger
@@ -870,6 +872,7 @@
def write_hunks(self, srcname, tgtname, hunks):
+ mode = os.stat(srcname)[ST_MODE]
src = open(srcname, "rb")
tgt = open(tgtname, "wb")
@@ -879,6 +882,9 @@
tgt.close()
src.close()
+
+ if mode != os.stat(tgtname)[ST_MODE]:
+ os.chmod(tgtname, mode)
return True
Original comment by azasyp...@gmail.com
on 4 Apr 2011 at 7:46
Good catch. Thanks. I'll integrate this as soon as I have an idea of a proper
unittest for that.
Original comment by techtonik@gmail.com
on 6 Apr 2011 at 9:05
Original comment by techtonik@gmail.com
on 10 Jan 2012 at 9:14
This issue was closed by revision r157.
Original comment by techtonik@gmail.com
on 10 Jan 2012 at 11:38
Original issue reported on code.google.com by
azasyp...@gmail.com
on 4 Apr 2011 at 7:19