~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
69
69
    lru_cache,
70
70
    pack,
71
71
    progress,
 
72
    static_tuple,
72
73
    trace,
73
74
    tsort,
74
75
    tuned_gzip,
1710
1711
            # There were index entries buffered at the end of the stream,
1711
1712
            # So these need to be added (if the index supports holding such
1712
1713
            # entries for later insertion)
 
1714
            all_entries = []
1713
1715
            for key in buffered_index_entries:
1714
1716
                index_entries = buffered_index_entries[key]
1715
 
                self._index.add_records(index_entries,
1716
 
                    missing_compression_parents=True)
 
1717
                all_entries.extend(index_entries)
 
1718
            self._index.add_records(
 
1719
                all_entries, missing_compression_parents=True)
1717
1720
 
1718
1721
    def get_missing_compression_parent_keys(self):
1719
1722
        """Return an iterable of keys of missing compression parents.
2365
2368
    FLAGS is a comma separated list of flags about the record. Values include
2366
2369
        no-eol, line-delta, fulltext.
2367
2370
    BYTE_OFFSET is the ascii representation of the byte offset in the data file
2368
 
        that the the compressed data starts at.
 
2371
        that the compressed data starts at.
2369
2372
    LENGTH is the ascii representation of the length of the data file.
2370
2373
    PARENT_ID a utf-8 revision id prefixed by a '.' that is a parent of
2371
2374
        REVISION_ID.
2942
2945
        if not random_id:
2943
2946
            present_nodes = self._get_entries(keys)
2944
2947
            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]
2945
2952
                if (value[0] != keys[key][0][0] or
2946
 
                    node_refs[:1] != keys[key][1][:1]):
 
2953
                    parents != passed_parents):
 
2954
                    node_refs = static_tuple.as_tuples(node_refs)
2947
2955
                    raise KnitCorrupt(self, "inconsistent details in add_records"
2948
 
                        ": %s %s" % ((value, node_refs), keys[key]))
 
2956
                        ": %s %s" % ((value, node_refs), passed))
2949
2957
                del keys[key]
2950
2958
        result = []
2951
2959
        if self._parents: