~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robey Pointer
  • Date: 2006-09-03 00:28:18 UTC
  • mfrom: (1981 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1996.
  • Revision ID: robey@lag.net-20060903002818-71ca5c7bfea93a26
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
            # check for out of date working trees
248
248
            # if we are bound, then self.branch is the master branch and this
249
249
            # test is thus all we need.
250
 
            if self.work_tree.last_revision() != self.master_branch.last_revision():
 
250
            master_last = self.master_branch.last_revision()
 
251
            if (master_last is not None and 
 
252
                master_last != self.work_tree.last_revision()):
251
253
                raise errors.OutOfDateTree(self.work_tree)
252
254
    
253
255
            if strict:
279
281
            if len(self.parents) > 1 and self.specific_files:
280
282
                raise NotImplementedError('selected-file commit of merges is not supported yet: files %r',
281
283
                        self.specific_files)
282
 
            self._check_parents_present()
 
284
            
283
285
            self.builder = self.branch.get_commit_builder(self.parents, 
284
286
                self.config, timestamp, timezone, committer, revprops, rev_id)
285
287
            
317
319
            # and now do the commit locally.
318
320
            self.branch.append_revision(self.rev_id)
319
321
 
320
 
            self.work_tree.set_pending_merges([])
321
 
            self.work_tree.set_last_revision(self.rev_id)
 
322
            # if the builder gave us the revisiontree it created back, we
 
323
            # could use it straight away here.
 
324
            # TODO: implement this.
 
325
            self.work_tree.set_parent_trees([(self.rev_id,
 
326
                self.branch.repository.revision_tree(self.rev_id))])
322
327
            # now the work tree is up to date with the branch
323
328
            
324
329
            self.reporter.completed(self.branch.revno(), self.rev_id)
438
443
        self.parent_invs = []
439
444
        for revision in self.parents:
440
445
            if self.branch.repository.has_revision(revision):
 
446
                mutter('commit parent revision {%s}', revision)
441
447
                inventory = self.branch.repository.get_inventory(revision)
442
448
                self.parent_invs.append(inventory)
 
449
            else:
 
450
                mutter('commit parent ghost revision {%s}', revision)
443
451
 
444
 
    def _check_parents_present(self):
445
 
        for parent_id in self.parents:
446
 
            mutter('commit parent revision {%s}', parent_id)
447
 
            if not self.branch.repository.has_revision(parent_id):
448
 
                if parent_id == self.branch.last_revision():
449
 
                    warning("parent is missing %r", parent_id)
450
 
                    raise BzrCheckError("branch %s is missing revision {%s}"
451
 
                            % (self.branch, parent_id))
452
 
            
453
452
    def _remove_deleted(self):
454
453
        """Remove deleted files from the working inventories.
455
454