~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2006-02-22 04:29:54 UTC
  • mfrom: (1566 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1569.
  • Revision ID: mbp@sourcefrog.net-20060222042954-60333f08dd56a646
[merge] from bzr.dev before integration
Fix undefined ordering in sign_my_revisions breaking tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
                            sha_string, sha_strings, sha_file, isdir, isfile,
80
80
                            split_lines)
81
81
import bzrlib.config
 
82
import bzrlib.errors as errors
82
83
from bzrlib.errors import (BzrError, PointlessCommit,
83
84
                           HistoryMissing,
84
85
                           ConflictsInTree,
214
215
                 "deprecated as of bzr 0.8. Please use working_tree= instead.",
215
216
                 DeprecationWarning, stacklevel=2)
216
217
            self.branch = branch
217
 
            self.work_tree = WorkingTree(branch.base, branch)
 
218
            self.work_tree = self.branch.bzrdir.open_workingtree()
218
219
        elif working_tree is None:
219
220
            raise BzrError("One of branch and working_tree must be passed into commit().")
220
221
        else:
231
232
        if revprops:
232
233
            self.revprops.update(revprops)
233
234
 
 
235
        # check for out of date working trees
 
236
        if self.work_tree.last_revision() != self.branch.last_revision():
 
237
            raise errors.OutOfDateTree(self.work_tree)
 
238
 
234
239
        if strict:
235
240
            # raise an exception as soon as we find a single unknown.
236
241
            for unknown in self.work_tree.unknowns():
269
274
        self.branch.lock_write()
270
275
        try:
271
276
            self.work_inv = self.work_tree.inventory
272
 
            self.basis_tree = self.branch.basis_tree()
 
277
            self.basis_tree = self.work_tree.basis_tree()
273
278
            self.basis_inv = self.basis_tree.inventory
274
279
 
275
280
            self._gather_parents()