/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 bzrlib/knit.py

  • Committer: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

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,
 
76
    ui,
75
77
    )
76
78
""")
77
79
from bzrlib import (
1754
1756
        :return: An iterator over (line, key).
1755
1757
        """
1756
1758
        if pb is None:
1757
 
            pb = progress.DummyProgress()
 
1759
            pb = ui.ui_factory.nested_progress_bar()
1758
1760
        keys = set(keys)
1759
1761
        total = len(keys)
1760
1762
        done = False
2367
2369
    FLAGS is a comma separated list of flags about the record. Values include
2368
2370
        no-eol, line-delta, fulltext.
2369
2371
    BYTE_OFFSET is the ascii representation of the byte offset in the data file
2370
 
        that the the compressed data starts at.
 
2372
        that the compressed data starts at.
2371
2373
    LENGTH is the ascii representation of the length of the data file.
2372
2374
    PARENT_ID a utf-8 revision id prefixed by a '.' that is a parent of
2373
2375
        REVISION_ID.
2944
2946
        if not random_id:
2945
2947
            present_nodes = self._get_entries(keys)
2946
2948
            for (index, key, value, node_refs) in present_nodes:
 
2949
                parents = node_refs[:1]
 
2950
                # Sometimes these are passed as a list rather than a tuple
 
2951
                passed = static_tuple.as_tuples(keys[key])
 
2952
                passed_parents = passed[1][:1]
2947
2953
                if (value[0] != keys[key][0][0] or
2948
 
                    node_refs[:1] != keys[key][1][:1]):
 
2954
                    parents != passed_parents):
 
2955
                    node_refs = static_tuple.as_tuples(node_refs)
2949
2956
                    raise KnitCorrupt(self, "inconsistent details in add_records"
2950
 
                        ": %s %s" % ((value, node_refs), keys[key]))
 
2957
                        ": %s %s" % ((value, node_refs), passed))
2951
2958
                del keys[key]
2952
2959
        result = []
2953
2960
        if self._parents:
3702
3709
 
3703
3710
try:
3704
3711
    from bzrlib._knit_load_data_pyx import _load_data_c as _load_data
3705
 
except ImportError:
 
3712
except ImportError, e:
 
3713
    osutils.failed_to_load_extension(e)
3706
3714
    from bzrlib._knit_load_data_py import _load_data_py as _load_data