~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robey Pointer
  • Date: 2006-09-08 18:52:17 UTC
  • mfrom: (1993 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1996.
  • Revision ID: robey@lag.net-20060908185217-6a4406e1d41753f5
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
245
245
            self._check_bound_branch()
246
246
 
247
247
            # check for out of date working trees
248
 
            # if we are bound, then self.branch is the master branch and this
249
 
            # test is thus all we need.
 
248
            try:
 
249
                first_tree_parent = self.work_tree.get_parent_ids()[0]
 
250
            except IndexError:
 
251
                # if there are no parents, treat our parent as 'None'
 
252
                # this is so that we still consier the master branch
 
253
                # - in a checkout scenario the tree may have no
 
254
                # parents but the branch may do.
 
255
                first_tree_parent = None
250
256
            master_last = self.master_branch.last_revision()
251
 
            if (master_last is not None and 
252
 
                master_last != self.work_tree.last_revision()):
 
257
            if (master_last is not None and
 
258
                master_last != first_tree_parent):
253
259
                raise errors.OutOfDateTree(self.work_tree)
254
260
    
255
261
            if strict:
462
468
        """
463
469
        specific = self.specific_files
464
470
        deleted_ids = []
 
471
        deleted_paths = set()
465
472
        for path, ie in self.work_inv.iter_entries():
 
473
            if is_inside_any(deleted_paths, path):
 
474
                # The tree will delete the required ids recursively.
 
475
                continue
466
476
            if specific and not is_inside_any(specific, path):
467
477
                continue
468
478
            if not self.work_tree.has_filename(path):
 
479
                deleted_paths.add(path)
469
480
                self.reporter.missing(path)
470
 
                deleted_ids.append((path, ie.file_id))
471
 
        if deleted_ids:
472
 
            deleted_ids.sort(reverse=True)
473
 
            for path, file_id in deleted_ids:
474
 
                del self.work_inv[file_id]
475
 
            self.work_tree._write_inventory(self.work_inv)
 
481
                deleted_ids.append(ie.file_id)
 
482
        self.work_tree.unversion(deleted_ids)
476
483
 
477
484
    def _populate_new_inv(self):
478
485
        """Build revision inventory.