~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/memory.py

(mbp) merge bzr.dev to 0.8, prepare for release

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
        else:
96
96
            return temp_t.base[:-1]
97
97
 
98
 
    def append(self, relpath, f):
 
98
    def append(self, relpath, f, mode=None):
99
99
        """See Transport.append()."""
100
100
        _abspath = self._abspath(relpath)
101
101
        self._check_parent(_abspath)
102
102
        orig_content, orig_mode = self._files.get(_abspath, ("", None))
103
 
        self._files[_abspath] = (orig_content + f.read(), orig_mode)
 
103
        if mode is None:
 
104
            mode = orig_mode
 
105
        self._files[_abspath] = (orig_content + f.read(), mode)
104
106
        return len(orig_content)
105
107
 
106
108
    def _check_parent(self, _abspath):