/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/mutabletree.py

  • Committer: Ian Clatworthy
  • Date: 2008-12-15 06:18:29 UTC
  • mfrom: (3905 +trunk)
  • mto: (3586.1.23 views-ui)
  • mto: This revision was merged to the branch mainline in revision 4030.
  • Revision ID: ian.clatworthy@canonical.com-20081215061829-c8qwa93g71u9fsh5
merge bzr.dev 3905

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
        from bzrlib import commit
182
182
        if revprops is None:
183
183
            revprops = {}
 
184
        possible_master_transports=[]
184
185
        if not 'branch-nick' in revprops:
185
 
            revprops['branch-nick'] = self.branch.nick
 
186
            revprops['branch-nick'] = self.branch._get_nick(
 
187
                kwargs.get('local', False),
 
188
                possible_master_transports)
186
189
        author = kwargs.pop('author', None)
187
190
        if author is not None:
188
191
            if 'author' in revprops:
194
197
        for hook in MutableTree.hooks['start_commit']:
195
198
            hook(self)
196
199
        committed_id = commit.Commit().commit(working_tree=self,
197
 
            revprops=revprops, *args, **kwargs)
 
200
            revprops=revprops,
 
201
            possible_master_transports=possible_master_transports,
 
202
            *args, **kwargs)
198
203
        return committed_id
199
204
 
200
205
    def _gather_kinds(self, files, kinds):
201
206
        """Helper function for add - sets the entries of kinds."""
202
207
        raise NotImplementedError(self._gather_kinds)
203
208
 
 
209
    def get_file_with_stat(self, file_id, path=None):
 
210
        """Get a file handle and stat object for file_id.
 
211
 
 
212
        The default implementation returns (self.get_file, None) for backwards
 
213
        compatibility.
 
214
 
 
215
        :param file_id: The file id to read.
 
216
        :param path: The path of the file, if it is known.
 
217
        :return: A tuple (file_handle, stat_value_or_None). If the tree has
 
218
            no stat facility, or need for a stat cache feedback during commit,
 
219
            it may return None for the second element of the tuple.
 
220
        """
 
221
        return (self.get_file(file_id, path), None)
 
222
 
204
223
    @needs_read_lock
205
224
    def last_revision(self):
206
225
        """Return the revision id of the last commit performed in this tree.
247
266
        """
248
267
        raise NotImplementedError(self.mkdir)
249
268
 
 
269
    def _observed_sha1(self, file_id, path, (sha1, stat_value)):
 
270
        """Tell the tree we have observed a paths sha1.
 
271
 
 
272
        The intent of this function is to allow trees that have a hashcache to
 
273
        update the hashcache during commit. If the observed file is too new
 
274
        (based on the stat_value) to be safely hash-cached the tree will ignore
 
275
        it. 
 
276
 
 
277
        The default implementation does nothing.
 
278
 
 
279
        :param file_id: The file id
 
280
        :param path: The file path
 
281
        :param sha1: The sha 1 that was observed.
 
282
        :param stat_value: A stat result for the file the sha1 was read from.
 
283
        :return: None
 
284
        """
 
285
 
250
286
    @needs_write_lock
251
287
    def put_file_bytes_non_atomic(self, file_id, bytes):
252
288
        """Update the content of a file in the tree.