/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/inventory.py

  • Committer: Ian Clatworthy
  • Date: 2007-08-30 02:00:37 UTC
  • mto: (2772.2.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2774.
  • Revision ID: ian.clatworthy@internode.on.net-20070830020037-lvqrgnm7lbmmcl8y
Incorporate feedback from abentley

Show diffs side-by-side

added added

removed removed

Lines of Context:
703
703
    def snapshot(self, revision, path, previous_entries,
704
704
                 work_tree, commit_builder):
705
705
        """See InventoryEntry.snapshot."""
706
 
        # We have a custom implementation of this for files because it's
707
 
        # performance critical.
 
706
        # Note: We use a custom implementation of this method for files
 
707
        # because it's a performance critical part of commit.
 
708
 
 
709
        # If this is the initial commit for this file, we know the sha is
 
710
        # coming later so skip caluculating it now (in _read_tree_state())
708
711
        if len(previous_entries) == 0:
709
 
            # Initial commit so we know the sha is coming later
710
712
            self.executable = work_tree.is_executable(self.file_id, path=path)
711
713
        else:
712
714
            self._read_tree_state(path, work_tree)
713
 
            if len(previous_entries) == 1:
714
 
                parent_ie = previous_entries.values()[0]
715
 
                if self._unchanged(parent_ie):
716
 
                    self.revision = parent_ie.revision
717
 
                    return False
 
715
 
 
716
        # If nothing is changed from the sole parent, there's nothing to do
 
717
        if len(previous_entries) == 1:
 
718
            parent_ie = previous_entries.values()[0]
 
719
            if self._unchanged(parent_ie):
 
720
                self.revision = parent_ie.revision
 
721
                return False
 
722
 
 
723
        # Add the file to the repository
718
724
        self.revision = revision
719
725
        def get_content_byte_lines():
720
726
            return work_tree.get_file(self.file_id, path).readlines()