40
40
h = self._branch.get_history()
41
41
config = self._branch.config
44
revid = h.fix_revid(args[0])
48
file_id = kw.get('file_id', None)
49
query = kw.get('q', None)
50
start_revid = h.fix_revid(kw.get('start_revid', None))
51
orig_start_revid = start_revid
52
pagesize = int(config.get('pagesize', '20'))
46
revid = h.fix_revid(args[0])
56
revid, start_revid, revid_list = h.get_view(revid, start_revid, file_id, query)
57
kw['start_revid'] = start_revid
60
if (query is not None) and (len(revid_list) == 0):
63
if len(revid_list) == 0:
64
scan_list = revid_list
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
68
if revid in revid_list: # XXX is this always true?
69
i = revid_list.index(revid)
72
scan_list = revid_list[i:]
73
change_list = scan_list[:pagesize]
74
changes = list(h.get_changes(change_list))
75
h.add_changes(changes)
77
self.log.exception('Exception fetching changes')
78
raise InternalError('Could not fetch changes')
80
navigation = util.Container(pagesize=pagesize, revid=revid, start_revid=start_revid, revid_list=revid_list,
81
file_id=file_id, scan_url='/changes', branch=self._branch, feed=True)
83
navigation.query = query
84
util.fill_in_navigation(navigation)
86
# add parent & merge-point branch-nick info, in case it's useful
87
h.get_branch_nicks(changes)
89
# does every change on this page have the same committer? if so,
90
# tell the template to show committer info in the "details block"
91
# instead of on each line.
92
all_same_author = True
95
author = changes[0].author
97
if e.author != author:
98
all_same_author = False
102
'branch': self._branch,
107
'navigation': navigation,
109
'start_revid': start_revid,
110
'viewing_from': (orig_start_revid is not None) and (orig_start_revid != h.last_revid),
112
'search_failed': search_failed,
113
'all_same_author': all_same_author,
116
self.log.info('/changes %r: %r secs' % (revid, time.time() - z))
66
scan_list = revid_list[h.get_revid_sequence(revid_list, revid):]
67
entry_list = scan_list[:pagesize]
68
entries = h.get_changes(entry_list)
71
## print sys.exc_info()[2]
72
## import pdb; pdb.post_mortem(sys.exc_info()[2])
73
self.log.exception('Exception fetching changes')
74
raise InternalError('Could not fetch 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))