~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/history.py

  • Committer: Martin Albisetti
  • Date: 2008-06-19 16:35:15 UTC
  • mto: (157.1.3 loggerhead)
  • mto: This revision was merged to the branch mainline in revision 187.
  • Revision ID: argentina@gmail.com-20080619163515-afe879s0tqwrcrgd
 * Add new images and CSS for diff/revision view
 * Tweak global css

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
        self._lock = threading.RLock()
196
196
 
197
197
    @classmethod
198
 
    def from_branch(cls, branch):
 
198
    def from_branch(cls, branch, name=None):
199
199
        z = time.time()
200
200
        self = cls()
201
201
        self._branch = branch
202
202
        self._last_revid = self._branch.last_revision()
203
203
 
204
 
        self.log = logging.getLogger('loggerhead.%s' % (self._branch.nick,))
 
204
        if name is None:
 
205
            name = self._branch.nick
 
206
        self._name = name
 
207
        self.log = logging.getLogger('loggerhead.%s' % (name,))
205
208
 
206
209
        graph = branch.repository.get_graph()
207
210
        parent_map = dict(((key, value) for key, value in
252
255
        return revision_graph
253
256
 
254
257
    @classmethod
255
 
    def from_folder(cls, path):
 
258
    def from_folder(cls, path, name=None):
256
259
        b = bzrlib.branch.Branch.open(path)
257
260
        b.lock_read()
258
261
        try:
259
 
            return cls.from_branch(b)
 
262
            return cls.from_branch(b, name)
260
263
        finally:
261
264
            b.unlock()
262
265
 
285
288
    def get_config(self):
286
289
        return self._branch.get_config()
287
290
 
 
291
 
288
292
    def get_revno(self, revid):
289
293
        if revid not in self._revision_info:
290
294
            # ghost parent?