/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: 2020-05-06 02:13:25 UTC
  • mfrom: (7490.7.21 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200506021325-awbmmqu1zyorz7sj
Merge 3.1 branch.

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
 
 
23
21
from ... import (
24
22
    controldir,
25
23
    commands,
59
57
            r1 = revision[0].as_revision_id(branch)
60
58
            r2 = revision[1].as_revision_id(branch)
61
59
            inv_ids = g.find_unique_ancestors(r2, [r1])
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,))
 
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,))