~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-19 16:41:31 UTC
  • mfrom: (4788.2.2 2.1.0b3-gc-nogil)
  • Revision ID: pqm@pqm.ubuntu.com-20091119164131-pg4ky6zrxe6kpzhq
(jam) Release the gil during some of the core groupcompress code
        paths.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    knit,
32
32
    osutils,
33
33
    pack,
34
 
    static_tuple,
35
34
    trace,
36
35
    )
37
36
from bzrlib.btree_index import BTreeBuilder
1747
1746
                key = record.key
1748
1747
            self._unadded_refs[key] = record.parents
1749
1748
            yield found_sha1
1750
 
            as_st = static_tuple.StaticTuple.from_sequence
1751
 
            if record.parents is not None:
1752
 
                parents = as_st([as_st(p) for p in record.parents])
1753
 
            else:
1754
 
                parents = None
1755
 
            refs = static_tuple.StaticTuple(parents)
1756
 
            keys_to_add.append((key, '%d %d' % (start_point, end_point), refs))
 
1749
            keys_to_add.append((key, '%d %d' % (start_point, end_point),
 
1750
                (record.parents,)))
1757
1751
        if len(keys_to_add):
1758
1752
            flush()
1759
1753
        self._compressor = None
1883
1877
        if not random_id:
1884
1878
            present_nodes = self._get_entries(keys)
1885
1879
            for (index, key, value, node_refs) in present_nodes:
1886
 
                # Sometimes these are passed as a list rather than a tuple
1887
 
                node_refs = static_tuple.as_tuples(node_refs)
1888
 
                passed = static_tuple.as_tuples(keys[key])
1889
 
                if node_refs != passed[1]:
1890
 
                    details = '%s %s %s' % (key, (value, node_refs), passed)
 
1880
                if node_refs != keys[key][1]:
 
1881
                    details = '%s %s %s' % (key, (value, node_refs), keys[key])
1891
1882
                    if self._inconsistency_fatal:
1892
1883
                        raise errors.KnitCorrupt(self, "inconsistent details"
1893
1884
                                                 " in add_records: %s" %