~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconcile.py

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Reconcilers are able to fix some potential data errors in a branch."""
18
18
 
19
19
 
20
 
__all__ = ['reconcile', 'Reconciler', 'RepoReconciler', 'KnitReconciler']
 
20
__all__ = [
 
21
    'KnitReconciler',
 
22
    'reconcile',
 
23
    'Reconciler',
 
24
    'RepoReconciler',
 
25
    ]
21
26
 
22
27
 
23
28
from bzrlib import ui
77
82
class RepoReconciler(object):
78
83
    """Reconciler that reconciles a repository.
79
84
 
 
85
    The goal of repository reconciliation is to make any derived data
 
86
    consistent with the core data committed by a user. This can involve 
 
87
    reindexing, or removing unreferenced data if that can interfere with
 
88
    queries in a given repository.
 
89
 
80
90
    Currently this consists of an inventory reweave with revision cross-checks.
81
91
    """
82
92
 
170
180
                # This is done to avoid a revision_count * time-to-write additional overhead on 
171
181
                # reconcile.
172
182
                new_inventory_vf._check_write_ok()
173
 
                Weave._add_lines(new_inventory_vf, rev_id, parents, self.inventory.get_lines(rev_id),
174
 
                                 None)
 
183
                Weave._add_lines(new_inventory_vf, rev_id, parents,
 
184
                    self.inventory.get_lines(rev_id), None, None, None, False, True)
175
185
            else:
176
186
                new_inventory_vf.add_lines(rev_id, parents, self.inventory.get_lines(rev_id))
177
187
 
267
277
class KnitReconciler(RepoReconciler):
268
278
    """Reconciler that reconciles a knit format repository.
269
279
 
270
 
    This will detect garbage inventories and remove them.
271
 
 
272
 
    Inconsistent parentage is checked for in the revision weave.
 
280
    This will detect garbage inventories and remove them in thorough mode.
273
281
    """
274
282
 
275
283
    def _reconcile_steps(self):