/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-09 15:14:47 UTC
  • mto: This revision was merged to the branch mainline in revision 1912.
  • Revision ID: john@arbash-meinel.com-20060809151447-02e7a4ac00dc7eee
Make AtomicFile not do anything if not supplied a mode, clean up LocalTransport now that we do the right thing for None

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
            base = base + '/'
58
58
        super(LocalTransport, self).__init__(base)
59
59
        self._local_base = urlutils.local_path_from_url(base)
60
 
        self._get_default_modes()
61
 
 
62
 
    def _get_default_modes(self):
63
 
        """Figure out what the default file and directory modes are"""
64
 
        umask = osutils.get_umask()
65
 
        self._default_file_mode = 0666 & ~umask
66
 
        self._default_dir_mode = 0777 & ~umask
67
60
 
68
61
    def should_cache(self):
69
62
        return False
145
138
        """
146
139
        from bzrlib.atomicfile import AtomicFile
147
140
 
148
 
        if mode is None:
149
 
            mode = self._default_file_mode
150
141
        path = relpath
151
142
        try:
152
143
            path = self._abspath(relpath)
177
168
        path = relpath
178
169
        try:
179
170
            if mode is None:
180
 
                local_mode = self._default_dir_mode
 
171
                # os.mkdir() will filter through umask
 
172
                local_mode = 0777
181
173
            else:
182
174
                local_mode = mode
183
175
            path = self._abspath(relpath)
193
185
        """Append the text in the file-like object into the final location."""
194
186
        abspath = self._abspath(relpath)
195
187
        if mode is None:
196
 
            local_mode = self._default_file_mode
 
188
            # os.open() will automatically use the umask
 
189
            local_mode = 0666
197
190
        else:
198
191
            local_mode = mode
199
192
        try: