~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconcile.py

  • Committer: Vincent Ladeuil
  • Date: 2011-07-06 09:22:00 UTC
  • mfrom: (6008 +trunk)
  • mto: (6012.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6013.
  • Revision ID: v.ladeuil+lp@free.fr-20110706092200-7iai2mwzc0sqdsvf
MergingĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from bzrlib import (
30
30
    cleanup,
31
31
    errors,
 
32
    revision as _mod_revision,
32
33
    ui,
33
34
    )
34
35
from bzrlib.trace import mutter
64
65
        """Perform reconciliation.
65
66
 
66
67
        After reconciliation the following attributes document found issues:
67
 
        inconsistent_parents: The number of revisions in the repository whose
68
 
                              ancestry was being reported incorrectly.
69
 
        garbage_inventories: The number of inventory objects without revisions
70
 
                             that were garbage collected.
71
 
        fixed_branch_history: None if there was no branch, False if the branch
72
 
                              history was correct, True if the branch history
73
 
                              needed to be re-normalized.
 
68
 
 
69
        * `inconsistent_parents`: The number of revisions in the repository
 
70
          whose ancestry was being reported incorrectly.
 
71
        * `garbage_inventories`: The number of inventory objects without
 
72
          revisions that were garbage collected.
 
73
        * `fixed_branch_history`: None if there was no branch, False if the
 
74
          branch history was correct, True if the branch history needed to be
 
75
          re-normalized.
74
76
        """
75
77
        self.pb = ui.ui_factory.nested_progress_bar()
76
78
        try:
143
145
        self._reconcile_revision_history()
144
146
 
145
147
    def _reconcile_revision_history(self):
146
 
        repo = self.branch.repository
147
148
        last_revno, last_revision_id = self.branch.last_revision_info()
148
149
        real_history = []
 
150
        graph = self.branch.repository.get_graph()
149
151
        try:
150
 
            for revid in repo.iter_reverse_revision_history(
151
 
                    last_revision_id):
 
152
            for revid in graph.iter_lefthand_ancestry(
 
153
                    last_revision_id, (_mod_revision.NULL_REVISION,)):
152
154
                real_history.append(revid)
153
155
        except errors.RevisionNotPresent:
154
156
            pass # Hit a ghost left hand parent
196
198
        """Perform reconciliation.
197
199
 
198
200
        After reconciliation the following attributes document found issues:
199
 
        inconsistent_parents: The number of revisions in the repository whose
200
 
                              ancestry was being reported incorrectly.
201
 
        garbage_inventories: The number of inventory objects without revisions
202
 
                             that were garbage collected.
 
201
 
 
202
        * `inconsistent_parents`: The number of revisions in the repository
 
203
          whose ancestry was being reported incorrectly.
 
204
        * `garbage_inventories`: The number of inventory objects without
 
205
          revisions that were garbage collected.
203
206
        """
204
207
        operation = cleanup.OperationWithCleanups(self._reconcile)
205
208
        self.add_cleanup = operation.add_cleanup
224
227
        only data-loss causing issues (!self.thorough) or all issues
225
228
        (self.thorough) are treated as requiring the reweave.
226
229
        """
227
 
        # local because needing to know about WeaveFile is a wart we want to hide
228
 
        from bzrlib.weave import WeaveFile, Weave
229
230
        transaction = self.repo.get_transaction()
230
231
        self.pb.update('Reading inventory data')
231
232
        self.inventory = self.repo.inventories