##// END OF EJS Templates
make the journal/undo files from transactions inherit the mode from .hg/store
Alexis S. L. Carvalho -
r6065:53ed9b40 default
parent child Browse files
Show More
@@ -78,6 +78,7 b' class localrepository(repo.repository):'
78 except OSError:
78 except OSError:
79 mode = None
79 mode = None
80
80
81 self._createmode = mode
81 self.opener.createmode = mode
82 self.opener.createmode = mode
82 sopener = util.opener(self.spath)
83 sopener = util.opener(self.spath)
83 sopener.createmode = mode
84 sopener.createmode = mode
@@ -564,7 +565,8 b' class localrepository(repo.repository):'
564 (self.join("journal.branch"), self.join("undo.branch"))]
565 (self.join("journal.branch"), self.join("undo.branch"))]
565 tr = transaction.transaction(self.ui.warn, self.sopener,
566 tr = transaction.transaction(self.ui.warn, self.sopener,
566 self.sjoin("journal"),
567 self.sjoin("journal"),
567 aftertrans(renames))
568 aftertrans(renames),
569 self._createmode)
568 self._transref = weakref.ref(tr)
570 self._transref = weakref.ref(tr)
569 return tr
571 return tr
570
572
@@ -15,7 +15,7 b' from i18n import _'
15 import os
15 import os
16
16
17 class transaction(object):
17 class transaction(object):
18 def __init__(self, report, opener, journal, after=None):
18 def __init__(self, report, opener, journal, after=None, createmode=None):
19 self.journal = None
19 self.journal = None
20
20
21 self.count = 1
21 self.count = 1
@@ -27,6 +27,8 b' class transaction(object):'
27 self.journal = journal
27 self.journal = journal
28
28
29 self.file = open(self.journal, "w")
29 self.file = open(self.journal, "w")
30 if createmode is not None:
31 os.chmod(self.journal, createmode & 0666)
30
32
31 def __del__(self):
33 def __del__(self):
32 if self.journal:
34 if self.journal:
@@ -48,7 +48,7 b' echo'
48 echo '% after commit'
48 echo '% after commit'
49 echo '% working dir files can only be written by the owner'
49 echo '% working dir files can only be written by the owner'
50 echo '% files created in .hg can be written by the group'
50 echo '% files created in .hg can be written by the group'
51 echo '% (in particular, store/**, dirstate, branch.cache)'
51 echo '% (in particular, store/**, dirstate, branch.cache, undo files)'
52 echo '% new directories are setgid'
52 echo '% new directories are setgid'
53 python ../printmodes.py .
53 python ../printmodes.py .
54
54
@@ -9,7 +9,7 b' 02770 ./.hg/store/'
9 % after commit
9 % after commit
10 % working dir files can only be written by the owner
10 % working dir files can only be written by the owner
11 % files created in .hg can be written by the group
11 % files created in .hg can be written by the group
12 % (in particular, store/**, dirstate, branch.cache)
12 % (in particular, store/**, dirstate, branch.cache, undo files)
13 % new directories are setgid
13 % new directories are setgid
14 00700 ./.hg/
14 00700 ./.hg/
15 00600 ./.hg/00changelog.i
15 00600 ./.hg/00changelog.i
@@ -22,7 +22,7 b' 02770 ./.hg/store/data/'
22 02770 ./.hg/store/data/dir/
22 02770 ./.hg/store/data/dir/
23 00660 ./.hg/store/data/dir/bar.i
23 00660 ./.hg/store/data/dir/bar.i
24 00660 ./.hg/store/data/foo.i
24 00660 ./.hg/store/data/foo.i
25 00600 ./.hg/store/undo
25 00660 ./.hg/store/undo
26 00660 ./.hg/undo.branch
26 00660 ./.hg/undo.branch
27 00660 ./.hg/undo.dirstate
27 00660 ./.hg/undo.dirstate
28 00700 ./dir/
28 00700 ./dir/
@@ -49,6 +49,6 b' 00770 ../push/.hg/store/data/'
49 00770 ../push/.hg/store/data/dir/
49 00770 ../push/.hg/store/data/dir/
50 00660 ../push/.hg/store/data/dir/bar.i
50 00660 ../push/.hg/store/data/dir/bar.i
51 00660 ../push/.hg/store/data/foo.i
51 00660 ../push/.hg/store/data/foo.i
52 00600 ../push/.hg/store/undo
52 00660 ../push/.hg/store/undo
53 00660 ../push/.hg/undo.branch
53 00660 ../push/.hg/undo.branch
54 00660 ../push/.hg/undo.dirstate
54 00660 ../push/.hg/undo.dirstate
General Comments 0
You need to be logged in to leave comments. Login now