~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Vincent Ladeuil
  • Date: 2009-11-03 09:32:17 UTC
  • mto: (4784.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4785.
  • Revision ID: v.ladeuil+lp@free.fr-20091103093217-sodpsi6fzb36vk9y
Hooks daughter classes should always call the base constructor

* bzrlib/tests/test_hooks.py:
(TestHookRegistry.test_items_are_reasonable_keys): Reproduce bug
#389648 and ensures we won't regress again.

* bzrlib/version_info_formats/format_rio.py:
(RioVersionInfoBuilderHooks.__init__): Call base constructor.

* bzrlib/info.py:
(InfoHooks.__init__): Call base constructor.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
    lru_cache,
70
70
    pack,
71
71
    progress,
72
 
    static_tuple,
73
72
    trace,
74
73
    tsort,
75
74
    tuned_gzip,
2945
2944
        if not random_id:
2946
2945
            present_nodes = self._get_entries(keys)
2947
2946
            for (index, key, value, node_refs) in present_nodes:
2948
 
                parents = node_refs[:1]
2949
 
                # Sometimes these are passed as a list rather than a tuple
2950
 
                passed = static_tuple.as_tuples(keys[key])
2951
 
                passed_parents = passed[1][:1]
2952
2947
                if (value[0] != keys[key][0][0] or
2953
 
                    parents != passed_parents):
2954
 
                    node_refs = static_tuple.as_tuples(node_refs)
 
2948
                    node_refs[:1] != keys[key][1][:1]):
2955
2949
                    raise KnitCorrupt(self, "inconsistent details in add_records"
2956
 
                        ": %s %s" % ((value, node_refs), passed))
 
2950
                        ": %s %s" % ((value, node_refs), keys[key]))
2957
2951
                del keys[key]
2958
2952
        result = []
2959
2953
        if self._parents: