/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

make the file-id cache optional and branch-ref aware

Show diffs side-by-side

added added

removed removed

Lines of Context:
414
414
                pass
415
415
            self.cache_mgr._blobs = {}
416
416
            self._revision_count += 1
417
 
            # If we're finished getting back to where we were,
418
 
            # load the file-ids cache
419
 
            if self._revision_count == self.skip_total:
420
 
                self._gen_file_ids_cache()
421
417
            return
422
418
        if self.first_incremental_commit:
423
419
            self.first_incremental_commit = None
424
420
            parents = self.cache_mgr.track_heads(cmd)
425
 
            self._gen_file_ids_cache(parents)
426
421
 
427
422
        # 'Commit' the revision and report progress
428
423
        handler = self.commit_handler_factory(cmd, self.cache_mgr,
442
437
                self._revision_count)
443
438
            self.checkpoint_handler(None)
444
439
 
445
 
    def _gen_file_ids_cache(self, revs=False):
446
 
        """Generate the file-id cache by searching repository inventories.
447
 
        """
448
 
        # Get the interesting revisions - the heads
449
 
        if revs:
450
 
            head_ids = revs
451
 
        else:
452
 
            head_ids = self.cache_mgr.heads.keys()
453
 
        revision_ids = [self.cache_mgr.revision_ids[h] for h in head_ids]
454
 
 
455
 
        # Update the fileid cache
456
 
        file_ids = {}
457
 
        for revision_id in revision_ids:
458
 
            self.note("Collecting file-ids for head %s ..." % revision_id)
459
 
            inv = self.repo.revision_tree(revision_id).inventory
460
 
            # Cache the inventories while we're at it
461
 
            self.cache_mgr.inventories[revision_id] = inv
462
 
            for path, ie in inv.iter_entries():
463
 
                file_ids[path] = ie.file_id
464
 
        self.cache_mgr.file_ids = file_ids
465
 
        self.note("Generated the file-ids cache - %d entries" % len(file_ids))
466
 
 
467
440
    def report_progress(self, details=''):
468
441
        if self._revision_count % self.progress_every == 0:
469
442
            if self.total_commits is not None: