/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 breezy/plugins/repodebug/check_chk.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
"""
20
20
 
 
21
from __future__ import absolute_import
 
22
 
21
23
from ... import (
22
24
    controldir,
23
25
    commands,
57
59
            r1 = revision[0].as_revision_id(branch)
58
60
            r2 = revision[1].as_revision_id(branch)
59
61
            inv_ids = g.find_unique_ancestors(r2, [r1])
60
 
        with ui.ui_factory.nested_progress_bar() as pb:
61
 
            for idx, inv in enumerate(repo.iter_inventories(inv_ids)):
62
 
                pb.update('checking', idx, len(inv_ids))
63
 
                d = dict(inv.id_to_entry.iteritems())
64
 
                test_key = chk_map.CHKMap.from_dict(
65
 
                    vf, d, maximum_size=inv.id_to_entry._root_node._maximum_size,
66
 
                    key_width=inv.id_to_entry._root_node._key_width,
67
 
                    search_key_func=inv.id_to_entry._search_key_func)
68
 
                if inv.id_to_entry.key() != test_key:
69
 
                    trace.warning('Failed for id_to_entry inv: %s'
70
 
                                  % (inv.revision_id,))
71
 
                pid = inv.parent_id_basename_to_file_id
72
 
                d = dict(pid.iteritems())
73
 
                test_key = chk_map.CHKMap.from_dict(
74
 
                    vf, d, maximum_size=pid._root_node._maximum_size,
75
 
                    key_width=pid._root_node._key_width,
76
 
                    search_key_func=pid._search_key_func)
77
 
                if pid.key() != test_key:
78
 
                    trace.warning('Failed for parent_id_to_basename inv: %s'
79
 
                                  % (inv.revision_id,))
 
62
        pb = ui.ui_factory.nested_progress_bar()
 
63
        self.add_cleanup(pb.finished)
 
64
        for idx, inv in enumerate(repo.iter_inventories(inv_ids)):
 
65
            pb.update('checking', idx, len(inv_ids))
 
66
            d = dict(inv.id_to_entry.iteritems())
 
67
            test_key = chk_map.CHKMap.from_dict(
 
68
                vf, d, maximum_size=inv.id_to_entry._root_node._maximum_size,
 
69
                key_width=inv.id_to_entry._root_node._key_width,
 
70
                search_key_func=inv.id_to_entry._search_key_func)
 
71
            if inv.id_to_entry.key() != test_key:
 
72
                trace.warning('Failed for id_to_entry inv: %s'
 
73
                              % (inv.revision_id,))
 
74
            pid = inv.parent_id_basename_to_file_id
 
75
            d = dict(pid.iteritems())
 
76
            test_key = chk_map.CHKMap.from_dict(
 
77
                vf, d, maximum_size=pid._root_node._maximum_size,
 
78
                key_width=pid._root_node._key_width,
 
79
                search_key_func=pid._search_key_func)
 
80
            if pid.key() != test_key:
 
81
                trace.warning('Failed for parent_id_to_basename inv: %s'
 
82
                              % (inv.revision_id,))