~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-12-20 14:20:04 UTC
  • mfrom: (2974.2.3 fast_diff_versus_empty)
  • Revision ID: pqm@pqm.ubuntu.com-20071220142004-tw2cffgn9fxq5ra0
(jam) re-enable the fast _iter_changes versus the null revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
        self._dirstate = None
152
152
        self._inventory = None
153
153
        #-------------
 
154
        self._setup_directory_is_tree_reference()
154
155
        self._detect_case_handling()
155
156
 
156
157
    @needs_tree_write_lock
1735
1736
        # NB: show_status depends on being able to pass in non-versioned files
1736
1737
        # and report them as unknown
1737
1738
        # TODO: handle extra trees in the dirstate.
1738
 
        # TODO: handle comparisons as an empty tree as a different special
1739
 
        # case? mbp 20070226
1740
 
        if (extra_trees or (self.source._revision_id == NULL_REVISION)
1741
 
            or specific_files == []):
 
1739
        if (extra_trees or specific_files == []):
1742
1740
            # we can't fast-path these cases (yet)
1743
1741
            for f in super(InterDirStateTree, self)._iter_changes(
1744
1742
                include_unchanged, specific_files, pb, extra_trees,
1746
1744
                yield f
1747
1745
            return
1748
1746
        parent_ids = self.target.get_parent_ids()
1749
 
        assert (self.source._revision_id in parent_ids), \
 
1747
        assert (self.source._revision_id in parent_ids
 
1748
                or self.source._revision_id == NULL_REVISION), \
1750
1749
                "revision {%s} is not stored in {%s}, but %s " \
1751
1750
                "can only be used for trees stored in the dirstate" \
1752
1751
                % (self.source._revision_id, self.target, self._iter_changes)
1759
1758
                "Failure: source._revision_id: %s not in target.parent_ids(%s)" % (
1760
1759
                self.source._revision_id, parent_ids)
1761
1760
            source_index = 1 + parent_ids.index(self.source._revision_id)
1762
 
            indices = (source_index,target_index)
 
1761
            indices = (source_index, target_index)
1763
1762
        # -- make all specific_files utf8 --
1764
1763
        if specific_files:
1765
1764
            specific_files_utf8 = set()