~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Mark Hammond
  • Date: 2008-12-28 05:21:23 UTC
  • mfrom: (3920 +trunk)
  • mto: (3932.1.1 prepare-1.11)
  • mto: This revision was merged to the branch mainline in revision 3937.
  • Revision ID: mhammond@skippinet.com.au-20081228052123-f78xs5sbdkotshwf
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
285
285
        self.committer = committer
286
286
        self.strict = strict
287
287
        self.verbose = verbose
288
 
        # accumulates an inventory delta to the basis entry, so we can make
289
 
        # just the necessary updates to the workingtree's cached basis.
290
 
        self._basis_delta = []
291
288
 
292
289
        self.work_tree.lock_write()
293
290
        self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
355
352
                    entries_title="Directory")
356
353
            self.builder = self.branch.get_commit_builder(self.parents,
357
354
                self.config, timestamp, timezone, committer, revprops, rev_id)
358
 
            
 
355
 
359
356
            try:
 
357
                self.builder.will_record_deletes()
360
358
                # find the location being committed to
361
359
                if self.bound_branch:
362
360
                    master_location = self.master_branch.base
414
412
            # Make the working tree up to date with the branch
415
413
            self._set_progress_stage("Updating the working tree")
416
414
            self.work_tree.update_basis_by_delta(self.rev_id,
417
 
                 self._basis_delta)
 
415
                 self.builder.get_basis_delta())
418
416
            self.reporter.completed(new_revno, self.rev_id)
419
417
            self._process_post_hooks(old_revno, new_revno)
420
418
        finally:
433
431
        # A merge with no effect on files
434
432
        if len(self.parents) > 1:
435
433
            return
436
 
        # TODO: we could simplify this by using self._basis_delta.
 
434
        # TODO: we could simplify this by using self.builder.basis_delta.
437
435
 
438
436
        # The initial commit adds a root directory, but this in itself is not
439
437
        # a worthwhile commit.
696
694
                # required after that changes.
697
695
                if len(self.parents) > 1:
698
696
                    ie.revision = None
699
 
                delta, version_recorded, _ = self.builder.record_entry_contents(
 
697
                _, version_recorded, _ = self.builder.record_entry_contents(
700
698
                    ie, self.parent_invs, path, self.basis_tree, None)
701
699
                if version_recorded:
702
700
                    self.any_entries_changed = True
703
 
                if delta:
704
 
                    self._basis_delta.append(delta)
705
701
 
706
702
    def _report_and_accumulate_deletes(self):
707
703
        # XXX: Could the list of deleted paths and ids be instead taken from
726
722
            deleted.sort()
727
723
            # XXX: this is not quite directory-order sorting
728
724
            for path, file_id in deleted:
729
 
                self._basis_delta.append((path, None, file_id, None))
 
725
                self.builder.record_delete(path, file_id)
730
726
                self.reporter.deleted(path)
731
727
 
732
728
    def _populate_from_inventory(self):
863
859
            ie.revision = None
864
860
        # For carried over entries we don't care about the fs hash - the repo
865
861
        # isn't generating a sha, so we're not saving computation time.
866
 
        delta, version_recorded, fs_hash = self.builder.record_entry_contents(
 
862
        _, version_recorded, fs_hash = self.builder.record_entry_contents(
867
863
            ie, self.parent_invs, path, self.work_tree, content_summary)
868
 
        if delta:
869
 
            self._basis_delta.append(delta)
870
864
        if version_recorded:
871
865
            self.any_entries_changed = True
872
866
        if report_changes: