139
143
# Remove the sticky and execute bits for files
140
144
self._file_mode = self._dir_mode & ~07111
146
@deprecated_method(deprecated_in((1, 6, 0)))
142
147
def controlfilename(self, file_or_path):
143
"""Return location relative to branch."""
148
"""Return location relative to branch.
150
:deprecated: Use Transport methods instead.
144
152
return self._transport.abspath(self._escape(file_or_path))
155
@deprecated_method(deprecated_in((1, 5, 0)))
147
156
def get(self, relpath):
148
"""Get a file as a bytestream."""
157
"""Get a file as a bytestream.
159
:deprecated: Use a Transport instead of LockableFiles.
149
161
relpath = self._escape(relpath)
150
162
return self._transport.get(relpath)
153
165
@deprecated_method(deprecated_in((1, 5, 0)))
154
166
def get_utf8(self, relpath):
155
"""Get a file as a unicode stream."""
167
"""Get a file as a unicode stream.
169
:deprecated: Use a Transport instead of LockableFiles.
156
171
relpath = self._escape(relpath)
157
172
# DO NOT introduce an errors=replace here.
158
173
return codecs.getreader('utf-8')(self._transport.get(relpath))
160
175
@needs_write_lock
176
@deprecated_method(deprecated_in((1, 6, 0)))
161
177
def put(self, path, file):
164
180
:param path: The path to put the file, relative to the .bzr control
166
:param f: A file-like or string object whose contents should be copied.
182
:param file: A file-like or string object whose contents should be copied.
184
:deprecated: Use Transport methods instead.
168
186
self._transport.put_file(self._escape(path), file, mode=self._file_mode)
170
188
@needs_write_lock
189
@deprecated_method(deprecated_in((1, 6, 0)))
171
190
def put_bytes(self, path, a_string):
172
191
"""Write a string of bytes.
174
193
:param path: The path to put the bytes, relative to the transport root.
175
:param string: A string object, whose exact bytes are to be copied.
194
:param a_string: A string object, whose exact bytes are to be copied.
196
:deprecated: Use Transport methods instead.
177
198
self._transport.put_bytes(self._escape(path), a_string,
178
199
mode=self._file_mode)
180
201
@needs_write_lock
202
@deprecated_method(deprecated_in((1, 6, 0)))
181
203
def put_utf8(self, path, a_string):
182
204
"""Write a string, encoding as utf-8.
184
206
:param path: The path to put the string, relative to the transport root.
185
207
:param string: A string or unicode object whose contents should be copied.
209
:deprecated: Use Transport methods instead.
187
211
# IterableFile would not be needed if Transport.put took iterables
188
212
# instead of files. ADHB 2005-12-25