~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconcile.py

  • Committer: Robert Collins
  • Date: 2006-02-25 00:54:16 UTC
  • mto: (1587.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1588.
  • Revision ID: robertc@robertcollins.net-20060225005416-e74996bec38de816
UI tweaks to reconcile - show progress for inventory backup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        # the total set of revisions to process
77
77
        self.pending = set([file_id for file_id in self.repo.revision_store])
78
78
 
79
 
        # total steps = 1 read per revision + one insert into the inventory
80
 
        self.total = len(self.pending) * 2
81
 
        self.count = 0
82
 
 
83
79
        # mapping from revision_id to parents
84
80
        self._rev_graph = {}
85
81
        # errors that we detect
86
82
        self.inconsistent_parents = 0
87
83
        # we need the revision id of each revision and its available parents list
 
84
        self._setup_steps(len(self.pending))
88
85
        for rev_id in self.pending:
89
86
            # put a revision into the graph.
90
87
            self._graph_revision(rev_id)
95
92
        if not self.inconsistent_parents and not self.garbage_inventories:
96
93
            self.pb.note('Inventory ok.')
97
94
            return
 
95
        self.pb.update('Backing up inventory...', 0, 0)
98
96
        self.repo.control_weaves.put_weave('inventory.backup',
99
97
                                           self.inventory,
100
98
                                           self.repo.get_transaction())
104
102
            self.repo.get_transaction())
105
103
 
106
104
        # we have topological order of revisions and non ghost parents ready.
 
105
        self._setup_steps(len(self._rev_graph))
107
106
        for rev_id in TopoSorter(self._rev_graph.items()).iter_topo_order():
108
107
            parents = self._rev_graph[rev_id]
109
108
            # double check this really is in topological order.
124
123
        self.inventory = None
125
124
        self.pb.note('Inventory regenerated.')
126
125
 
 
126
    def _setup_steps(self, new_total):
 
127
        """Setup the markers we need to control the progress bar."""
 
128
        self.total = new_total
 
129
        self.count = 0
 
130
 
127
131
    def _graph_revision(self, rev_id):
128
132
        """Load a revision into the revision graph."""
129
133
        # pick a random revision