# # # patch "ChangeLog" # from [2f53a621e78d70464a48722c586ac3abd6efa4b5] # to [ce79bf0303b91f326b21b80791f11feccb73ef20] # # patch "templates/branchchangesrss.html" # from [815fa5b5b1d06136d19fbf83b3c9f0c521d7bb05] # to [d8a477c41c496f672863755ad8c79e840715ebcc] # # patch "viewmtn.py" # from [2ab7af7898c05351d6121d756037736fed7116b5] # to [da0bd746711f7fba726db7f95b5218b89e49ac2c] # ============================================================ --- ChangeLog 2f53a621e78d70464a48722c586ac3abd6efa4b5 +++ ChangeLog ce79bf0303b91f326b21b80791f11feccb73ef20 @@ -1,5 +1,13 @@ 2007-03-29 Grahame Bowland + * fix bug in revised get_last_changes; don't + loop forever when we run out of revisions to + look at + * format dates in recent list so as to follow + the RSS spec. + +2007-03-29 Grahame Bowland + * rewrite BranchChanges.get_last_changes, much more efficient algorithm suggested by Matthias Radestock. Use python's heapq class to get an efficient, sorted ============================================================ --- templates/branchchangesrss.html 815fa5b5b1d06136d19fbf83b3c9f0c521d7bb05 +++ templates/branchchangesrss.html d8a477c41c496f672863755ad8c79e840715ebcc @@ -15,7 +15,7 @@ $changelog #end filter $author - $when +0000 + $when #end for ============================================================ --- viewmtn.py 2ab7af7898c05351d6121d756037736fed7116b5 +++ viewmtn.py da0bd746711f7fba726db7f95b5218b89e49ac2c @@ -394,14 +394,16 @@ class BranchChanges: continue heapq.heappush(revq, ComparisonRev(parent_rev)) if len(revq) == 0: + to_parent = None break # follow the newest edge next_rev = heapq.heappop(revq) to_parent = [ next_rev ] result.append(next_rev) + if to_parent == None: + break rv = map (lambda x: (x.revision, x.certs), result[from_change:to_change]), revq - print >> sys.stderr, revq return rv def GET(self, branch, from_change, to_change, template_name): @@ -416,9 +418,9 @@ class BranchChanges: if cert[5] == "branch": rev_branch = cert[7] elif cert[5] == 'date': - when = cert[7] - revdate = common.parse_timecert(when) + revdate = common.parse_timecert(cert[7]) ago = common.ago(revdate) + when = revdate.strftime('%a, %d %b %Y %H:%M:%S GMT') elif cert[5] == 'author': author = mtn.Author(cert[7]) elif cert[5] == 'changelog':