~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

DirState: handle id lookup redirects correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
667
667
        :param path_utf8: An utf8 path to be looked up.
668
668
        :return: The dirstate entry tuple for path, or (None, None)
669
669
        """
 
670
        self._read_dirblocks_if_needed()
670
671
        if path_utf8 is not None:
671
672
            assert path_utf8.__class__ == str, 'path_utf8 is not a str: %s %s' % (type(path_utf8), path_utf8)
672
 
        self._read_dirblocks_if_needed()
673
 
        if path_utf8 is not None:
674
673
            # path lookups are faster
675
674
            if path_utf8 == '':
676
675
                for entry in self._root_entries:
695
694
                        # look up the real location directly by path
696
695
                        return self._get_entry(tree_index,
697
696
                            fileid_utf8=fileid_utf8,
698
 
                            path_utf8=entry[1][tree_index][0])
 
697
                            path_utf8=entry[1][tree_index][1])
699
698
                    if entry[1][tree_index][0] == 'absent':
700
699
                        # not in the tree at all.
701
700
                        return None, None