~ubuntu-branches/ubuntu/lucid/loggerhead/lucid-security

« back to all changes in this revision

Viewing changes to loggerhead/history.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2008-12-09 01:04:39 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081209010439-67a169sw58q1nru3
Tags: 1.10-1
* New upstream release.
* Stop writing home directory to pid file. (Closes: #507002)
* Use objlib from bzr. (Closes: #506999)
* Fix dependency on python-paste.

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
        self._file_change_cache = None
208
208
        self._branch = branch
209
209
        self._inventory_cache = {}
210
 
        self.log = logging.getLogger('loggerhead.%s' % branch.nick)
 
210
        self._branch_nick = self._branch.get_config().get_nickname()
 
211
        self.log = logging.getLogger('loggerhead.%s' % self._branch_nick)
211
212
 
212
213
        self.last_revid = branch.last_revision()
213
214
 
278
279
            revids = [r for r in self._full_history if r in w_revids]
279
280
        except AttributeError:
280
281
            possible_keys = [(file_id, revid) for revid in self._full_history]
281
 
            existing_keys = self._branch.repository.texts.get_parent_map(
282
 
                                possible_keys)
283
 
            revids = [revid for _, revid in existing_keys.iterkeys()]
 
282
            get_parent_map = self._branch.repository.texts.get_parent_map
 
283
            # We chunk the requests as this works better with GraphIndex.
 
284
            # See _filter_revisions_touching_file_id in bzrlib/log.py
 
285
            # for more information.
 
286
            revids = []
 
287
            chunk_size = 1000
 
288
            for start in xrange(0, len(possible_keys), chunk_size):
 
289
                next_keys = possible_keys[start:start + chunk_size]
 
290
                revids += [k[1] for k in get_parent_map(next_keys)]
 
291
            del possible_keys, next_keys
284
292
        return revids
285
293
 
286
294
    def get_revision_history_since(self, revid_list, date):
367
375
            if self.revno_re.match(revid):
368
376
                revid = self._revno_revid[revid]
369
377
        except KeyError:
370
 
            raise bzrlib.errors.NoSuchRevision(self._branch.nick, revid)
 
378
            raise bzrlib.errors.NoSuchRevision(self._branch_nick, revid)
371
379
        return revid
372
380
 
373
381
    def get_file_view(self, revid, file_id):