~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconcile.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-09-24 09:45:23 UTC
  • mfrom: (4712.1.4 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090924094523-nsz6mp3qwor3xpp3
(mbp) deprecate ProgressTask.note

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
            # Nothing to check here
91
91
            self.fixed_branch_history = None
92
92
            return
93
 
        self.pb.note('Reconciling branch %s',
94
 
                     self.branch.base)
 
93
        ui.ui_factory.note('Reconciling branch %s' % self.branch.base)
95
94
        branch_reconciler = self.branch.reconcile(thorough=True)
96
95
        self.fixed_branch_history = branch_reconciler.fixed_history
97
96
 
98
97
    def _reconcile_repository(self):
99
98
        self.repo = self.bzrdir.find_repository()
100
 
        self.pb.note('Reconciling repository %s',
101
 
                     self.repo.bzrdir.root_transport.base)
 
99
        ui.ui_factory.note('Reconciling repository %s' %
 
100
            self.repo.bzrdir.root_transport.base)
102
101
        self.pb.update("Reconciling repository", 0, 1)
103
102
        repo_reconciler = self.repo.reconcile(thorough=True)
104
103
        self.inconsistent_parents = repo_reconciler.inconsistent_parents
105
104
        self.garbage_inventories = repo_reconciler.garbage_inventories
106
105
        if repo_reconciler.aborted:
107
 
            self.pb.note(
 
106
            ui.ui_factory.note(
108
107
                'Reconcile aborted: revision index has inconsistent parents.')
109
 
            self.pb.note(
 
108
            ui.ui_factory.note(
110
109
                'Run "bzr check" for more details.')
111
110
        else:
112
 
            self.pb.note('Reconciliation complete.')
 
111
            ui.ui_factory.note('Reconciliation complete.')
113
112
 
114
113
 
115
114
class BranchReconciler(object):
151
150
            # set_revision_history, as this will regenerate it again.
152
151
            # Not really worth a whole BranchReconciler class just for this,
153
152
            # though.
154
 
            self.pb.note('Fixing last revision info %s => %s',
155
 
                         last_revno, len(real_history))
 
153
            ui.ui_factory.note('Fixing last revision info %s => %s' % (
 
154
                 last_revno, len(real_history)))
156
155
            self.branch.set_last_revision_info(len(real_history),
157
156
                                               last_revision_id)
158
157
        else:
159
158
            self.fixed_history = False
160
 
            self.pb.note('revision_history ok.')
 
159
            ui.ui_factory.note('revision_history ok.')
161
160
 
162
161
 
163
162
class RepoReconciler(object):
238
237
        # (no garbage inventories or we are not doing a thorough check)
239
238
        if (not self.inconsistent_parents and
240
239
            (not self.garbage_inventories or not self.thorough)):
241
 
            self.pb.note('Inventory ok.')
 
240
            ui.ui_factory.note('Inventory ok.')
242
241
            return
243
242
        self.pb.update('Backing up inventory', 0, 0)
244
243
        self.repo._backup_inventory()
245
 
        self.pb.note('Backup inventory created.')
 
244
        ui.ui_factory.note('Backup inventory created.')
246
245
        new_inventories = self.repo._temp_inventories()
247
246
 
248
247
        # we have topological order of revisions and non ghost parents ready.
261
260
        self.pb.update('Writing weave')
262
261
        self.repo._activate_new_inventory()
263
262
        self.inventory = None
264
 
        self.pb.note('Inventory regenerated.')
 
263
        ui.ui_factory.note('Inventory regenerated.')
265
264
 
266
265
    def _new_inv_parents(self, revision_key):
267
266
        """Lookup ghost-filtered parents for revision_key."""
368
367
        self._check_garbage_inventories()
369
368
        self.pb.update('Checking unused inventories', 1, 3)
370
369
        if not self.garbage_inventories:
371
 
            self.pb.note('Inventory ok.')
 
370
            ui.ui_factory.note('Inventory ok.')
372
371
            return
373
372
        self.pb.update('Backing up inventory', 0, 0)
374
373
        self.repo._backup_inventory()
375
 
        self.pb.note('Backup Inventory created')
 
374
        ui.ui_factory.note('Backup Inventory created')
376
375
        # asking for '' should never return a non-empty weave
377
376
        new_inventories = self.repo._temp_inventories()
378
377
        # we have topological order of revisions and non ghost parents ready.
392
391
        self.pb.update('Writing weave')
393
392
        self.repo._activate_new_inventory()
394
393
        self.inventory = None
395
 
        self.pb.note('Inventory regenerated.')
 
394
        ui.ui_factory.note('Inventory regenerated.')
396
395
 
397
396
    def _fix_text_parents(self):
398
397
        """Fix bad versionedfile parent entries.