/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Ian Clatworthy
  • Date: 2007-07-23 03:57:11 UTC
  • mto: (2647.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2648.
  • Revision ID: ian.clatworthy@internode.on.net-20070723035711-a4y0zt5vvbaiuxty
Clean-up comments and make use of self.builder.record_root_entry more explicit

Show diffs side-by-side

added added

removed removed

Lines of Context:
592
592
        mutter("Selecting files for commit with filter %s", specific_files)
593
593
 
594
594
        # Check and warn about old CommitBuilders
595
 
        old_commit_builder = not self.builder.record_root_entry
596
 
        if old_commit_builder:
 
595
        if not self.builder.record_root_entry:
597
596
            symbol_versioning.warn('CommitBuilders should support recording'
598
597
                ' the root entry as of bzr 0.10.', DeprecationWarning, 
599
598
                stacklevel=1)
600
599
            self.builder.new_inventory.add(self.basis_inv.root.copy())
601
600
 
602
601
        # Build the new inventory
603
 
        self._populate_from_inventory(specific_files, old_commit_builder)
 
602
        self._populate_from_inventory(specific_files)
604
603
 
605
 
        # If specific files/directories were nominated, it is possible
606
 
        # that some data from outside those needs to be preserved from
607
 
        # the basis tree. For example, if a file x is moved from out of
608
 
        # directory foo into directory bar and the user requests
609
 
        # ``commit foo``, then information about bar/x must also be
610
 
        # recorded.
611
 
        # ABENTLEY says:
612
 
        # This implies that bar knows what its children are, which isn't
613
 
        # really accurate.  Strictly speaking, bar only needs to be committed
614
 
        # if it wasn't a directory in the basis tree - the current
615
 
        # implementation is overkill.
 
604
        # If specific files are selected, then all un-selected files must be
 
605
        # recorded in their previous state. For more details, see
 
606
        # https://lists.ubuntu.com/archives/bazaar/2007q3/028476.html.
616
607
        if specific_files:
617
608
            for path, new_ie in self.basis_inv.iter_entries():
618
609
                if new_ie.file_id in self.builder.new_inventory:
631
622
            if ie.file_id not in self.builder.new_inventory:
632
623
                self.reporter.deleted(path)
633
624
 
634
 
    def _populate_from_inventory(self, specific_files, skip_first_entry):
 
625
    def _populate_from_inventory(self, specific_files):
635
626
        """Populate the CommitBuilder by walking the working tree inventory."""
636
627
        if self.strict:
637
628
            # raise an exception as soon as we find a single unknown.
643
634
        work_inv = self.work_tree.inventory
644
635
        assert work_inv.root is not None
645
636
        entries = work_inv.iter_entries()
646
 
        if skip_first_entry:
 
637
        if not self.builder.record_root_entry:
647
638
            entries.next()
648
639
        for path, existing_ie in entries:
649
640
            file_id = existing_ie.file_id