~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Martin Pool
  • Date: 2007-03-06 01:27:22 UTC
  • mto: (2255.2.200 subtree)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: mbp@sourcefrog.net-20070306012722-e91h0sxbcutqb4ng
Comments and better assertions in InterDirStateTree

Show diffs side-by-side

added added

removed removed

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