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

Show diffs side-by-side

added added

removed removed

Lines of Context:
1435
1435
        if 'index' in debug.debug_flags:
1436
1436
            mutter('CombinedGraphIndex reordering: currently %r, promoting %r',
1437
1437
                   indices_info, hit_indices)
1438
 
        hit_indices_info = []
1439
1438
        hit_names = []
1440
 
        unhit_indices_info = []
1441
 
        for name, idx in indices_info:
 
1439
        unhit_names = []
 
1440
        new_hit_indices = []
 
1441
        unhit_indices = []
 
1442
 
 
1443
        for offset, (name, idx) in enumerate(indices_info):
1442
1444
            if idx in hit_indices:
1443
 
                info = hit_indices_info
1444
1445
                hit_names.append(name)
 
1446
                new_hit_indices.append(idx)
 
1447
                if len(new_hit_indices) == len(hit_indices):
 
1448
                    # We've found all of the hit entries, everything else is
 
1449
                    # unhit
 
1450
                    unhit_names.extend(self._index_names[offset+1:])
 
1451
                    unhit_indices.extend(self._indices[offset+1:])
 
1452
                    break
1445
1453
            else:
1446
 
                info = unhit_indices_info
1447
 
            info.append((name, idx))
1448
 
        final_info = hit_indices_info + unhit_indices_info
1449
 
        self._indices = [idx for (name, idx) in final_info]
1450
 
        self._index_names = [name for (name, idx) in final_info]
 
1454
                unhit_names.append(name)
 
1455
                unhit_indices.append(idx)
 
1456
 
 
1457
        self._indices = new_hit_indices + unhit_indices
 
1458
        self._index_names = hit_names + unhit_names
1451
1459
        if 'index' in debug.debug_flags:
1452
1460
            mutter('CombinedGraphIndex reordered: %r', self._indices)
1453
1461
        return hit_names