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

  • Committer: Martin Pool
  • Date: 2007-03-07 03:09:14 UTC
  • mto: (2321.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: mbp@sourcefrog.net-20070307030914-fb2gw9ae6lxcbbcd
Review cleanups: mostly updating or removing todo comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
389
389
        # check file id is valid unconditionally.
390
390
        entry = self._get_entry(file_id=file_id, path=path)
391
391
        assert entry[0] is not None, 'what error should this raise'
392
 
        # TODO:
393
 
        # if row stat is valid, use cached sha1, else, get a new sha1.
394
392
        if path is None:
395
393
            path = pathjoin(entry[0][0], entry[0][1]).decode('utf8')
396
394
 
684
682
            rollbacks = []
685
683
            def rollback_rename():
686
684
                """A single rename has failed, roll it back."""
 
685
                # roll back everything, even if we encounter trouble doing one
 
686
                # of them.
 
687
                #
 
688
                # TODO: at least log the other exceptions rather than just
 
689
                # losing them mbp 20070307
687
690
                exc_info = None
688
691
                for rollback in reversed(rollbacks):
689
692
                    try:
690
693
                        rollback()
691
694
                    except Exception, e:
692
 
                        import pdb;pdb.set_trace()
693
695
                        exc_info = sys.exc_info()
694
696
                if exc_info:
695
697
                    raise exc_info[0], exc_info[1], exc_info[2]
1529
1531
            self._repository.unlock()
1530
1532
 
1531
1533
    def walkdirs(self, prefix=""):
1532
 
        # TODO: jam 20070215 This is the cheap way by cheating and using the
1533
 
        #       RevisionTree implementation.
1534
 
        #       This should be cleaned up to use the much faster Dirstate code
1535
 
        #       This is a little tricky, though, because the dirstate is
1536
 
        #       indexed by current path, not by parent path.
1537
 
        #       So for now, we just build up the parent inventory, and extract
1538
 
        #       it the same way RevisionTree does.
 
1534
        # TODO: jam 20070215 This is the lazy way by using the RevisionTree
 
1535
        # implementation based on an inventory.  
 
1536
        # This should be cleaned up to use the much faster Dirstate code
 
1537
        # So for now, we just build up the parent inventory, and extract
 
1538
        # it the same way RevisionTree does.
1539
1539
        _directory = 'directory'
1540
1540
        inv = self._get_inventory()
1541
1541
        top_id = inv.path2id(prefix)
1763
1763
                tuple will be ignored, and don't want to take the time to
1764
1764
                decode.
1765
1765
            """
1766
 
            # TODO: when a parent has been renamed, dont emit path renames for children,
1767
 
            ## if path_info[1] == 'sub':
1768
 
            ##     import pdb;pdb.set_trace()
1769
1766
            if source_index is None:
1770
1767
                source_details = NULL_PARENT_DETAILS
1771
1768
            else:
1954
1951
                ## import pdb;pdb.set_trace()
1955
1952
            return ()
1956
1953
        while search_specific_files:
1957
 
            # TODO: the pending list should be lexically sorted?
 
1954
            # TODO: the pending list should be lexically sorted?  the
 
1955
            # interface doesn't require it.
1958
1956
            current_root = search_specific_files.pop()
1959
1957
            searched_specific_files.add(current_root)
1960
1958
            # process the entries for this containing directory: the rest will be
2034
2032
                    assert current_dir_info[1][bzr_index][0] == '.bzr'
2035
2033
                    del current_dir_info[1][bzr_index]
2036
2034
            # walk until both the directory listing and the versioned metadata
2037
 
            # are exhausted. TODO: reevaluate this, perhaps we should stop when
2038
 
            # the versioned data runs out.
 
2035
            # are exhausted. 
2039
2036
            if (block_index < len(state._dirblocks) and
2040
2037
                osutils.is_inside(current_root, state._dirblocks[block_index][0])):
2041
2038
                current_block = state._dirblocks[block_index]
2140
2137
                        if current_path_info[1] < current_entry[0][1]:
2141
2138
                            # extra file on disk: pass for now, but only
2142
2139
                            # increment the path, not the entry
2143
 
                            # import pdb; pdb.set_trace()
2144
 
                            # print 'unversioned file'
2145
2140
                            advance_entry = False
2146
2141
                        else:
2147
2142
                            # entry referring to file not present on disk.