~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/changelog_ui.py

  • Committer: Martin Pool
  • Date: 2009-03-10 01:00:45 UTC
  • mto: This revision was merged to the branch mainline in revision 298.
  • Revision ID: mbp@sourcefrog.net-20090310010045-jfewn6fpuk1wngxw
This loggerhead will work with bzr 1.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
 
# Copyright (C) 2008, 2009 Canonical Ltd.
3
2
# Copyright (C) 2006  Robey Pointer <robey@lag.net>
4
3
# Copyright (C) 2006  Goffredo Baroncelli <kreijack@inwind.it>
5
4
#
18
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
18
#
20
19
 
21
 
import urllib
22
 
 
23
 
try:
24
 
    import simplejson
25
 
except ImportError:
26
 
    import json as simplejson
27
 
 
28
20
from paste.httpexceptions import HTTPServerError
29
21
 
30
22
from loggerhead import util
66
58
                scan_list = revid_list[i:]
67
59
            change_list = scan_list[:pagesize]
68
60
            changes = list(history.get_changes(change_list))
69
 
            data = {}
70
 
            for i, c in enumerate(changes):
71
 
                c.index = i
72
 
                data[str(i)] = urllib.quote(urllib.quote(c.revid, safe=''))
 
61
            history.add_changes(changes)
73
62
        except:
74
63
            self.log.exception('Exception fetching changes')
75
64
            raise HTTPServerError('Could not fetch changes')
82
71
            navigation.query = query
83
72
        util.fill_in_navigation(navigation)
84
73
 
 
74
        # add parent & merge-point branch-nick info, in case it's useful
 
75
        history.get_branch_nicks(changes)
 
76
 
85
77
        # Directory Breadcrumbs
86
78
        directory_breadcrumbs = (
87
79
            util.directory_breadcrumbs(
89
81
                self._branch.is_root,
90
82
                'changes'))
91
83
 
92
 
        show_tag_col = False
93
 
        for change in changes:
94
 
            if change.tags is not None:
95
 
                show_tag_col = True
96
 
                break
97
 
 
98
84
        return {
99
85
            'branch': self._branch,
100
86
            'changes': changes,
101
 
            'show_tag_col': show_tag_col,
102
 
            'data': simplejson.dumps(data),
103
87
            'util': util,
104
88
            'history': history,
105
89
            'revid': revid,
106
90
            'navigation': navigation,
107
91
            'filter_file_id': filter_file_id,
108
92
            'start_revid': start_revid,
109
 
            'viewing_from': (orig_start_revid is not None) and
 
93
            'viewing_from': (orig_start_revid is not None) and 
110
94
                            (orig_start_revid != history.last_revid),
111
95
            'query': query,
112
96
            'search_failed': search_failed,