/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

  • Committer: Ian Clatworthy
  • Date: 2009-02-19 07:13:43 UTC
  • mto: (0.64.125 trunk)
  • mto: This revision was merged to the branch mainline in revision 6631.
  • Revision ID: ian.clatworthy@canonical.com-20090219071343-kno3mkdy2bcmixcb
generalise RevisionLoader to RevisionStore as a repo abstraction

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    idmapfile,
38
38
    marks_file,
39
39
    processor,
40
 
    revisionloader,
 
40
    revision_store,
41
41
    )
42
42
 
43
43
 
133
133
        # mapping of tag name to revision_id
134
134
        self.tags = {}
135
135
 
136
 
        # Create the revision loader to use for committing, if any
137
 
        self.loader = self._loader_factory()
 
136
        # Create the revision store to use for committing, if any
 
137
        self.rev_store = self._revision_store_factory()
138
138
 
139
139
        # Disable autopacking if the repo format supports it.
140
140
        # THIS IS A HACK - there is no sanctioned way of doing this yet.
200
200
        else:
201
201
            self.total_commits = self.max_commits
202
202
 
203
 
    def _loader_factory(self):
204
 
        """Make a RevisionLoader based on what the repository supports."""
 
203
    def _revision_store_factory(self):
 
204
        """Make a RevisionStore based on what the repository supports."""
205
205
        new_repo_api = hasattr(self.repo, 'revisions')
206
206
        if new_repo_api:
207
 
            return revisionloader.RevisionLoader2(self.repo)
 
207
            return revision_store.RevisionStore2(self.repo)
208
208
        elif not self._experimental:
209
 
            return revisionloader.RevisionLoader1(self.repo)
 
209
            return revision_store.RevisionStore1(self.repo)
210
210
        else:
211
211
            def fulltext_when(count):
212
212
                total = self.total_commits
220
220
                        count)
221
221
                return fulltext
222
222
 
223
 
            return revisionloader.ImportRevisionLoader1(
 
223
            return revision_store.ImportRevisionStore1(
224
224
                self.repo, self.inventory_cache_size,
225
225
                fulltext_when=fulltext_when)
226
226
 
396
396
 
397
397
        # 'Commit' the revision and report progress
398
398
        handler = bzr_commit_handler.InventoryCommitHandler(cmd,
399
 
            self.cache_mgr, self.repo, self.loader, verbose=self.verbose)
 
399
            self.cache_mgr, self.rev_store, verbose=self.verbose)
400
400
        handler.process()
401
401
        self.cache_mgr.revision_ids[cmd.id] = handler.revision_id
402
402
        self._revision_count += 1