~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

Add simple test for WorkingTree.kind

Show diffs side-by-side

added added

removed removed

Lines of Context:
1509
1509
 
1510
1510
 
1511
1511
class InterDirStateTree(InterTree):
1512
 
    """Fast path optimiser for changes_from with dirstate trees."""
 
1512
    """Fast path optimiser for changes_from with dirstate trees.
 
1513
    
 
1514
    This is used only when both trees are in the dirstate working file, and 
 
1515
    the source is any parent within the dirstate, and the destination is 
 
1516
    the current working tree of the same dirstate.
 
1517
    """
 
1518
    # this could be generalized to allow comparisons between any trees in the
 
1519
    # dirstate, and possibly between trees stored in different dirstates.
1513
1520
 
1514
1521
    def __init__(self, source, target):
1515
1522
        super(InterDirStateTree, self).__init__(source, target)
1700
1707
                decode.
1701
1708
            """
1702
1709
            # TODO: when a parent has been renamed, dont emit path renames for children,
 
1710
            ## if path_info[1] == 'sub':
 
1711
            ##     import pdb;pdb.set_trace()
1703
1712
            if source_index is None:
1704
1713
                source_details = NULL_PARENT_DETAILS
1705
1714
            else:
1706
1715
                source_details = entry[1][source_index]
1707
1716
            target_details = entry[1][target_index]
1708
1717
            target_minikind = target_details[0]
1709
 
            if path_info is not None and target_minikind in 'fdl':
 
1718
            if path_info is not None and target_minikind in 'fdlt':
1710
1719
                assert target_index == 0
1711
1720
                link_or_sha1 = state.update_entry(entry, abspath=path_info[4],
1712
1721
                                                  stat_value=path_info[3])
1881
1890
                # is indirectly via test_too_much.TestCommands.test_conflicts.
1882
1891
                pass
1883
1892
            else:
1884
 
                print "*******", source_minikind, target_minikind
1885
 
                import pdb;pdb.set_trace()
 
1893
                raise AssertionError("don't know how to compare "
 
1894
                    "source_minikind=%r, target_minikind=%r"
 
1895
                    % (source_minikind, target_minikind))
 
1896
                ## import pdb;pdb.set_trace()
1886
1897
            return ()
1887
1898
        while search_specific_files:
1888
1899
            # TODO: the pending list should be lexically sorted?