~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

Move working tree initialisation out from  Branch.initialize, deprecated Branch.initialize to Branch.create.

Show diffs side-by-side

added added

removed removed

Lines of Context:
212
212
        if deprecated_passed(branch):
213
213
            warn("Commit.commit (branch, ...): The branch parameter is "
214
214
                 "deprecated as of bzr 0.8. Please use working_tree= instead.",
215
 
                 DeprecationWarning)
 
215
                 DeprecationWarning, stacklevel=2)
216
216
            self.branch = branch
217
217
            self.work_tree = WorkingTree(branch.base, branch)
218
218
        elif working_tree is None:
294
294
            self._make_revision()
295
295
            self.work_tree.set_pending_merges([])
296
296
            self.branch.append_revision(self.rev_id)
 
297
            if len(self.parents):
 
298
                precursor = self.parents[0]
 
299
            else:
 
300
                precursor = None
 
301
            self.work_tree.set_last_revision(self.rev_id, precursor)
297
302
            self.reporter.completed(self.branch.revno()+1, self.rev_id)
298
303
            if self.config.post_commit() is not None:
299
304
                hooks = self.config.post_commit().split(' ')