/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to processors/generic_processor.py

commit of new files working

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
        else:
221
221
            # use the bzr_revision_id to lookup the inv cache
222
222
            new_inventory = self.get_inventory(parents[0]).copy()
 
223
        if not self.repo.supports_rich_root():
 
224
            # In this repository, root entries have no knit or weave. When
 
225
            # serializing out to disk and back in, root.revision is always
 
226
            # the new revision_id.
 
227
            new_inventory.root.revision = self.revision_id
223
228
        new_inventory.apply_delta(self.inv_delta)
224
229
        self.cache_mgr.inventories[self.command.ref] = new_inventory
225
230
 
284
289
    def gen_initial_inventory(self):
285
290
        """Generate an inventory for a parentless revision."""
286
291
        inv = inventory.Inventory(revision_id=self.revision_id)
287
 
        if not self.repo.supports_rich_root():
288
 
            # In this repository, root entries have no knit or weave. When
289
 
            # serializing out to disk and back in, root.revision is always
290
 
            # the new revision_id.
291
 
            inv.root.revision = self.revision_id
292
292
        return inv
293
293
 
294
294
    def gen_revision_id(self):
350
350
        ie = inventory.make_entry(kind, basename, parent_ie, file_id)
351
351
        ie.revision = self.revision_id
352
352
        if isinstance(ie, inventory.InventoryFile):
353
 
            ie.text_sha1 = osutils.sha_strings(data)
354
 
            ie.text_size = len(data)
355
353
            ie.executable = is_executable
356
 
            lines = data.split('\n')
357
 
            if lines[-1] == '':
358
 
                lines.pop()
 
354
            lines = osutils.split_lines(data)
 
355
            ie.text_sha1 = osutils.sha_strings(lines)
 
356
            ie.text_size = sum(map(len, lines))
359
357
            self.lines_for_commit[file_id] = lines
360
358
        elif isinstance(ie, inventory.InventoryLnk):
361
359
            ie.symlink_target = data