/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/dirstate.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:
259
259
     # of using int conversion rather than a dict here. AND BLAME ANDREW IF
260
260
     # it is faster.
261
261
 
262
 
    # TODO: jam 20070221 Make sure we handle when there are duplicated records
263
 
    #       (like when we remove + add the same path, or we have a rename)
264
262
    # TODO: jam 20070221 Figure out what to do if we have a record that exceeds
265
263
    #       the BISECT_PAGE_SIZE. For now, we just have to make it large enough
266
264
    #       that we are sure a single record will always fit.
1554
1552
            tree_count = 1 + num_present_parents
1555
1553
            entry_size = self._fields_per_entry()
1556
1554
            expected_field_count = entry_size * self._num_entries
1557
 
            if len(fields) - cur > expected_field_count:
1558
 
                fields = fields[:expected_field_count + cur]
1559
 
                trace.mutter('Unexpectedly long dirstate field count!')
1560
 
                print "XXX: incorrectly truncated dirstate file bug triggered."
1561
1555
            field_count = len(fields)
1562
1556
            # this checks our adjustment, and also catches file too short.
1563
1557
            assert field_count - cur == expected_field_count, \
1753
1747
        :param new_id: The new id to assign to the path. This must be a utf8
1754
1748
            file id (not unicode, and not None).
1755
1749
        """
1756
 
        # TODO: start warning here.
1757
 
        assert new_id.__class__ == str
 
1750
        assert new_id.__class__ == str, \
 
1751
            "path_id %r is not a plain string" % (new_id,)
1758
1752
        self._read_dirblocks_if_needed()
1759
1753
        if len(path):
1760
 
            import pdb;pdb.set_trace()
1761
1754
            # logic not written
1762
1755
            raise NotImplementedError(self.set_path_id)
1763
1756
        # TODO: check new id is unique
1922
1915
        try to keep everything in sorted blocks all the time, but sometimes
1923
1916
        it's easier to sort after the fact.
1924
1917
        """
1925
 
        # TODO: Might be faster to do a scwartzian transform?
 
1918
        # TODO: Might be faster to do a schwartzian transform?
1926
1919
        def _key(entry):
1927
1920
            # sort by: directory parts, file name, file id
1928
1921
            return entry[0][0].split('/'), entry[0][1], entry[0][2]
2103
2096
                    # the test for existing kinds is different: this can be
2104
2097
                    # factored out to a helper though.
2105
2098
                    other_block_index, present = self._find_block_index_from_key(other_key)
2106
 
                    if not present:
2107
 
                        import pdb; pdb.set_trace()
2108
2099
                    assert present, 'could not find block for %s' % (other_key,)
2109
2100
                    other_entry_index, present = self._find_entry_index(other_key,
2110
2101
                                            self._dirblocks[other_block_index][1])
2111
 
                    if not present:
2112
 
                        import pdb; pdb.set_trace()
2113
2102
                    assert present, 'could not find entry for %s' % (other_key,)
2114
2103
                    assert path_utf8 is not None
2115
2104
                    self._dirblocks[other_block_index][1][other_entry_index][1][0] = \