From 825748611865259a3d5336c5ff7f61015de5b29a Mon Sep 17 00:00:00 2001 From: krishnatejaperannagari Date: Fri, 4 Jul 2014 13:56:18 +0530 Subject: [PATCH] changes to reviews Signed-off-by: krishnatejaperannagari --- buildfarm/web/__init__.py | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index 600ce751..e36da0e7 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -889,23 +889,13 @@ class RecentCheckinsPage(HistoryPage): limit = 10 - def render(self, myself, tree, gitcount=None, navigation=None, author=None): + def render(self, myself, tree, gitstart, author = None): t = self.buildfarm.trees[tree] interesting = list() authors = {"ALL": "ALL"} branch = t.get_branch() re_author = re.compile("^(.*) <(.*)>$") - - if navigation == "Previous": - gitstart = int(gitcount) - ( 2 * self.limit ) - gitstop = int(gitcount) - self.limit - elif navigation == "Next": - gitstart = int(gitcount) - gitstop = int(gitcount) + self.limit - else: - gitstart = 0 - gitstop = self.limit - + for entry in branch.log(limit=HISTORY_HORIZON): m = re_author.match(entry.author) authors[m.group(2)] = m.group(1) @@ -921,7 +911,9 @@ class RecentCheckinsPage(HistoryPage): yield "" % tree yield "" yield "" - + + gitstop = gitstart + self.limit + for entry in interesting[gitstart:gitstop]: changes = branch.changes_summary(entry.revision) yield "".join(self.history_row_html(myself, entry, t, changes)) @@ -930,9 +922,9 @@ class RecentCheckinsPage(HistoryPage): yield "
" yield "
\n" if gitstart != 0: - yield "" + yield "" if len(interesting) > gitstop: - yield "" + yield "" yield "" yield "" % gitstop if author and author != "ALL": @@ -1047,10 +1039,13 @@ class BuildFarmApp(object): elif fn_name == "Recent_Checkins": # validate the tree author = get_param(form, 'author') - gitcount = get_param(form, 'gitcount') - navigation = get_param(form, 'navigation') + gitstart = get_param(form, 'gitstart') + if gitstart == None: + gitstart = 0 + else: + gitstart = int(gitstart) page = RecentCheckinsPage(self.buildfarm) - yield "".join(self.html_page(form, page.render(myself, tree, gitcount, navigation, author))) + yield "".join(self.html_page(form, page.render(myself, tree, gitstart, author))) elif fn_name == "diff": revision = get_param(form, 'revision') page = DiffPage(self.buildfarm) -- 2.34.1