42
39
h = self._branch.get_history()
43
40
config = self._branch.config
46
revid = h.fix_revid(args[0])
50
file_id = kw.get('file_id', None)
51
query = kw.get('q', None)
52
start_revid = h.fix_revid(kw.get('start_revid', None))
53
orig_start_revid = start_revid
54
pagesize = int(config.get('pagesize', '20'))
58
revid, start_revid, revid_list = h.get_view(revid, start_revid, file_id, query)
59
kw['start_revid'] = start_revid
62
if (query is not None) and (len(revid_list) == 0):
65
if len(revid_list) == 0:
66
scan_list = revid_list
45
revid = h.fix_revid(args[0])
68
scan_list = revid_list[h.get_revid_sequence(revid_list, revid):]
69
entry_list = scan_list[:pagesize]
70
entries = h.get_changes(entry_list)
72
self.log.error('Exception fetching changes: %s' % (x,))
73
util.log_exception(self.log)
74
raise HTTPRedirect(self._branch.url('/changes'))
76
navigation = util.Container(pagesize=pagesize, revid=revid, start_revid=start_revid, revid_list=revid_list,
77
file_id=file_id, scan_url='/changes', branch=self._branch, feed=True)
79
navigation.query = query
80
util.fill_in_navigation(h, navigation)
82
entries = list(entries)
83
# add parent & merge-point branch-nick info, in case it's useful
84
h.get_branch_nicks(entries)
87
'branch': self._branch,
88
'changes': list(entries),
92
'navigation': navigation,
94
'start_revid': start_revid,
95
'viewing_from': (orig_start_revid is not None) and (orig_start_revid != h.last_revid),
97
'search_failed': search_failed,
100
self.log.info('/changes %r: %r secs' % (revid, time.time() - z))
49
file_id = kw.get('file_id', None)
50
query = kw.get('q', None)
51
start_revid = h.fix_revid(kw.get('start_revid', None))
52
orig_start_revid = start_revid
53
pagesize = int(config.get('pagesize', '20'))
57
revid, start_revid, revid_list = h.get_view(revid, start_revid, file_id, query)
58
kw['start_revid'] = start_revid
61
if (query is not None) and (len(revid_list) == 0):
64
if len(revid_list) == 0:
65
scan_list = revid_list
67
if revid in revid_list: # XXX is this always true?
68
i = revid_list.index(revid)
71
scan_list = revid_list[i:]
72
change_list = scan_list[:pagesize]
73
changes = list(h.get_changes(change_list))
74
h.add_changes(changes)
76
self.log.exception('Exception fetching changes')
77
raise InternalError('Could not fetch changes')
79
navigation = util.Container(pagesize=pagesize, revid=revid, start_revid=start_revid, revid_list=revid_list,
80
file_id=file_id, scan_url='/changes', branch=self._branch, feed=True)
82
navigation.query = query
83
util.fill_in_navigation(navigation)
85
# add parent & merge-point branch-nick info, in case it's useful
86
h.get_branch_nicks(changes)
88
# does every change on this page have the same committer? if so,
89
# tell the template to show committer info in the "details block"
90
# instead of on each line.
91
all_same_author = True
94
author = changes[0].author
96
if e.author != author:
97
all_same_author = False
101
'branch': self._branch,
106
'navigation': navigation,
108
'start_revid': start_revid,
109
'viewing_from': (orig_start_revid is not None) and (orig_start_revid != h.last_revid),
111
'search_failed': search_failed,
112
'all_same_author': all_same_author,
115
self.log.info('/changes %r: %r secs' % (revid, time.time() - z))