~timhatch/trac-bzr/thatch-dev

« back to all changes in this revision

Viewing changes to tracbzr/backend.py

  • Committer: Peter Dimov
  • Date: 2007-01-22 13:15:32 UTC
  • Revision ID: peter.dimov@calitko.org-20070122131532-xwwzha2zujdcvkr0
Passing a generator to string.join() throws an exception with Python 2.4.1. Rewrote it. Fixed a bad return value from _get_branch_history().

Show diffs side-by-side

added added

removed removed

Lines of Context:
342
342
        cached_history, old_mtime = cached
343
343
        relpath = ".bzr/branch/revision-history"
344
344
        if not branch.bzrdir.root_transport.has (relpath):
345
 
            return [] # branch corrupted or has no history
 
345
            return [], 0 # branch corrupted or has no history
346
346
        path = branch.bzrdir.root_transport.local_abspath(relpath)
347
347
        mtime = os.lstat(path).st_mtime
348
348
        if mtime > old_mtime: # append the new revisions to the cache
1143
1143
        if len(self.revision.parent_ids) > 1:
1144
1144
            for name, link in [('parent trees', ' * source:@%s'),
1145
1145
                               ('changesets', ' * [changeset:%s]')]:
1146
 
                yield name, '\n'.join(
1147
 
                    link % (self.bzr_repo.string_rev(self.branch, parent),)
1148
 
                    for parent in self.revision.parent_ids), True, ''
 
1146
                links = []
 
1147
                for parent in self.revision.parent_ids:
 
1148
                    links.append (link % self.bzr_repo.string_rev(self.branch, parent,))
 
1149
                yield name, '\n'.join(links), True, ''
1149
1150
 
1150
1151
    def get_changes(self):
1151
1152
        """Yield changes.