/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

remove --inv-fulltext option

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
# How many commits before automatically checkpointing
58
58
_DEFAULT_AUTO_CHECKPOINT = 10000
59
59
 
60
 
# How many commits before each inventory fulltext
61
 
_DEFAULT_INV_FULLTEXT = 200
62
 
 
63
60
# How many inventories to cache
64
61
_DEFAULT_INV_CACHE_SIZE = 10
65
62
 
102
99
    * count - only import this many commits then exit. If not set
103
100
      or negative, all commits are imported.
104
101
    
105
 
    * inv-fulltext - create an inventory fulltext every n commits.
106
 
      The default is 200.
107
 
 
108
102
    * inv-cache - number of inventories to cache.
109
103
      If not set, the default is 10.
110
104
 
122
116
        'checkpoint',
123
117
        'count',
124
118
        'inv-cache',
125
 
        'inv-fulltext',
126
119
        'experimental',
127
120
        'import-marks',
128
121
        'export-marks',
217
210
 
218
211
        # Create the revision loader needed for committing
219
212
        new_repo_api = hasattr(self.repo, 'revisions')
220
 
        if self._experimental:
 
213
        if new_repo_api:
 
214
            self.loader = revisionloader.RevisionLoader2(self.repo)
 
215
        elif not self._experimental:
 
216
            self.loader = revisionloader.RevisionLoader1(self.repo)
 
217
        else:
221
218
            def fulltext_when(count):
222
219
                total = self.total_commits
223
220
                if total is not None and count == total:
224
221
                    fulltext = True
225
222
                else:
226
 
                    fulltext = count % self.inv_fulltext_every == 0
 
223
                    # Create an inventory fulltext every 200 revisions
 
224
                    fulltext = count % 200 == 0
227
225
                if fulltext:
228
226
                    self.note("%d commits - storing inventory as full-text",
229
227
                        count)
230
228
                return fulltext
231
229
 
232
 
            if new_repo_api:
233
 
                self.loader = revisionloader.ImportRevisionLoader2(
234
 
                    self.repo, self.inventory_cache_size,
235
 
                    fulltext_when=fulltext_when)
236
 
            else:
237
 
                self.loader = revisionloader.ImportRevisionLoader1(
238
 
                    self.repo, self.inventory_cache_size,
239
 
                    fulltext_when=fulltext_when)
240
 
        else:
241
 
            if new_repo_api:
242
 
                self.loader = revisionloader.RevisionLoader2(self.repo)
243
 
            else:
244
 
                self.loader = revisionloader.RevisionLoader1(self.repo)
 
230
            self.loader = revisionloader.ImportRevisionLoader1(
 
231
                self.repo, self.inventory_cache_size,
 
232
                fulltext_when=fulltext_when)
245
233
 
246
234
        # Disable autopacking if the repo format supports it.
247
235
        # THIS IS A HACK - there is no sanctioned way of doing this yet.
284
272
        self.checkpoint_every = int(self.params.get('checkpoint',
285
273
            _DEFAULT_AUTO_CHECKPOINT))
286
274
 
287
 
        # Decide how often to fulltext the inventory
288
 
        self.inv_fulltext_every = int(self.params.get('inv-fulltext',
289
 
            _DEFAULT_INV_FULLTEXT))
290
 
 
291
275
        # Decide how big to make the inventory cache
292
276
        self.inventory_cache_size = int(self.params.get('inv-cache',
293
277
            _DEFAULT_INV_CACHE_SIZE))