~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/history.py

Merge my old pep8 branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
import re
35
35
import textwrap
36
36
 
37
 
import bzrlib
38
37
import bzrlib.branch
39
38
import bzrlib.delta
40
39
import bzrlib.errors
 
40
import bzrlib.revision
41
41
 
42
42
from loggerhead import search
43
43
from loggerhead import util
104
104
        return len(self.revid_list)
105
105
 
106
106
class FileChangeReporter(object):
 
107
 
107
108
    def __init__(self, old_inv, new_inv):
108
109
        self.added = []
109
110
        self.modified = []
187
188
        self._cache[key] = (revid, data)
188
189
 
189
190
 
190
 
class History (object):
 
191
class History(object):
191
192
    """Decorate a branch to provide information for rendering.
192
193
 
193
194
    History objects are expected to be short lived -- when serving a request
261
262
        self._branch = branch
262
263
        self._inventory_cache = {}
263
264
        self._branch_nick = self._branch.get_config().get_nickname()
264
 
        self.log = logging.getLogger('loggerhead.%s' % self._branch_nick)
 
265
        self.log = logging.getLogger('loggerhead.%s' % (self._branch_nick,))
265
266
 
266
267
        self.last_revid = branch.last_revision()
267
268
 
691
692
            text_changes: list((filename, file_id)),
692
693
        """
693
694
        repo = self._branch.repository
694
 
        if bzrlib.revision.is_null(old_revid) or \
695
 
               bzrlib.revision.is_null(new_revid):
 
695
        if (bzrlib.revision.is_null(old_revid) or
 
696
            bzrlib.revision.is_null(new_revid)):
696
697
            old_tree, new_tree = map(
697
698
                repo.revision_tree, [old_revid, new_revid])
698
699
        else: