~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: 2006-03-22 12:17:00 UTC
  • mfrom: (1616.1.10 bzr.mbp.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060322121700-79ce0be81013aba1
(mbp) pycurl fixes, other fixes, weave commands, verbose commit changes from robert

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
        self.repo.control_weaves.copy(self.inventory, 'inventory.backup', self.repo.get_transaction())
135
135
        self.pb.note('Backup Inventory created.')
136
136
        # asking for '' should never return a non-empty weave
137
 
        new_inventory = self.repo.control_weaves.get_empty('inventory.new',
 
137
        new_inventory_vf = self.repo.control_weaves.get_empty('inventory.new',
138
138
            self.repo.get_transaction())
139
139
 
140
140
        # we have topological order of revisions and non ghost parents ready.
142
142
        for rev_id in TopoSorter(self._rev_graph.items()).iter_topo_order():
143
143
            parents = self._rev_graph[rev_id]
144
144
            # double check this really is in topological order.
145
 
            unavailable = [p for p in parents if p not in new_inventory]
 
145
            unavailable = [p for p in parents if p not in new_inventory_vf]
146
146
            assert len(unavailable) == 0
147
147
            # this entry has all the non ghost parents in the inventory
148
148
            # file already.
149
149
            self._reweave_step('adding inventories')
150
 
            # ugly but needed, weaves are just way tooooo slow else.
151
 
            if isinstance(new_inventory, WeaveFile):
152
 
                Weave.add_lines(new_inventory, rev_id, parents, self.inventory.get_lines(rev_id))
 
150
            if isinstance(new_inventory_vf, WeaveFile):
 
151
                # It's really a WeaveFile, but we call straight into the
 
152
                # Weave's add method to disable the auto-write-out behaviour.
 
153
                new_inventory_vf._check_write_ok()
 
154
                Weave._add_lines(new_inventory_vf, rev_id, parents, self.inventory.get_lines(rev_id),
 
155
                                 None)
153
156
            else:
154
 
                new_inventory.add_lines(rev_id, parents, self.inventory.get_lines(rev_id))
 
157
                new_inventory_vf.add_lines(rev_id, parents, self.inventory.get_lines(rev_id))
155
158
 
156
 
        if isinstance(new_inventory, WeaveFile):
157
 
            new_inventory._save()
158
 
        # if this worked, the set of new_inventory.names should equal
 
159
        if isinstance(new_inventory_vf, WeaveFile):
 
160
            new_inventory_vf._save()
 
161
        # if this worked, the set of new_inventory_vf.names should equal
159
162
        # self.pending
160
 
        assert set(new_inventory.versions()) == self.pending
 
163
        assert set(new_inventory_vf.versions()) == self.pending
161
164
        self.pb.update('Writing weave')
162
 
        self.repo.control_weaves.copy(new_inventory, 'inventory', self.repo.get_transaction())
 
165
        self.repo.control_weaves.copy(new_inventory_vf, 'inventory', self.repo.get_transaction())
163
166
        self.repo.control_weaves.delete('inventory.new', self.repo.get_transaction())
164
167
        self.inventory = None
165
168
        self.pb.note('Inventory regenerated.')
258
261
        self.repo.control_weaves.copy(self.inventory, 'inventory.backup', self.transaction)
259
262
        self.pb.note('Backup Inventory created.')
260
263
        # asking for '' should never return a non-empty weave
261
 
        new_inventory = self.repo.control_weaves.get_empty('inventory.new',
 
264
        new_inventory_vf = self.repo.control_weaves.get_empty('inventory.new',
262
265
            self.transaction)
263
266
 
264
267
        # we have topological order of revisions and non ghost parents ready.
266
269
        for rev_id in TopoSorter(self.revisions.get_graph().items()).iter_topo_order():
267
270
            parents = self.revisions.get_parents(rev_id)
268
271
            # double check this really is in topological order.
269
 
            unavailable = [p for p in parents if p not in new_inventory]
 
272
            unavailable = [p for p in parents if p not in new_inventory_vf]
270
273
            assert len(unavailable) == 0
271
274
            # this entry has all the non ghost parents in the inventory
272
275
            # file already.
273
276
            self._reweave_step('adding inventories')
274
277
            # ugly but needed, weaves are just way tooooo slow else.
275
 
            new_inventory.add_lines(rev_id, parents, self.inventory.get_lines(rev_id))
 
278
            new_inventory_vf.add_lines(rev_id, parents, self.inventory.get_lines(rev_id))
276
279
 
277
 
        # if this worked, the set of new_inventory.names should equal
 
280
        # if this worked, the set of new_inventory_vf.names should equal
278
281
        # self.pending
279
 
        assert set(new_inventory.versions()) == set(self.revisions.versions())
 
282
        assert set(new_inventory_vf.versions()) == set(self.revisions.versions())
280
283
        self.pb.update('Writing weave')
281
 
        self.repo.control_weaves.copy(new_inventory, 'inventory', self.transaction)
 
284
        self.repo.control_weaves.copy(new_inventory_vf, 'inventory', self.transaction)
282
285
        self.repo.control_weaves.delete('inventory.new', self.transaction)
283
286
        self.inventory = None
284
287
        self.pb.note('Inventory regenerated.')