##// END OF EJS Templates
fixed wrong order of changes in feeds...
marcink -
r1162:76c5b69c beta
parent child Browse files
Show More
@@ -51,6 +51,25 b' class FeedController(BaseRepoController)'
51 self.ttl = "5"
51 self.ttl = "5"
52 self.feed_nr = 10
52 self.feed_nr = 10
53
53
54 def __changes(self, cs):
55 changes = ''
56
57 a = [n.path for n in cs.added]
58 if a:
59 changes += '\nA ' + '\nA '.join(a)
60
61 m = [n.path for n in cs.changed]
62 if m:
63 changes += '\nM ' + '\nM '.join(m)
64
65 d = [n.path for n in cs.removed]
66 if d:
67 changes += '\nD ' + '\nD '.join(d)
68
69 changes += '</pre>'
70
71 return changes
72
54 def atom(self, repo_name):
73 def atom(self, repo_name):
55 """Produce an atom-1.0 feed via feedgenerator module"""
74 """Produce an atom-1.0 feed via feedgenerator module"""
56 feed = Atom1Feed(title=self.title % repo_name,
75 feed = Atom1Feed(title=self.title % repo_name,
@@ -59,11 +78,15 b' class FeedController(BaseRepoController)'
59 language=self.language,
78 language=self.language,
60 ttl=self.ttl)
79 ttl=self.ttl)
61
80
62 for cs in c.rhodecode_repo[:self.feed_nr]:
81 for cs in reversed(list(c.rhodecode_repo[-self.feed_nr:])):
82 desc = '%s - %s<br/><pre>' % (cs.author, cs.date)
83 desc += self.__changes(cs)
84
63 feed.add_item(title=cs.message,
85 feed.add_item(title=cs.message,
64 link=url('changeset_home', repo_name=repo_name,
86 link=url('changeset_home', repo_name=repo_name,
65 revision=cs.raw_id, qualified=True),
87 revision=cs.raw_id, qualified=True),
66 description=str(cs.date))
88 author_name=cs.author,
89 description=desc)
67
90
68 response.content_type = feed.mime_type
91 response.content_type = feed.mime_type
69 return feed.writeString('utf-8')
92 return feed.writeString('utf-8')
@@ -77,11 +100,16 b' class FeedController(BaseRepoController)'
77 language=self.language,
100 language=self.language,
78 ttl=self.ttl)
101 ttl=self.ttl)
79
102
80 for cs in c.rhodecode_repo[:self.feed_nr]:
103 for cs in reversed(list(c.rhodecode_repo[-self.feed_nr:])):
104 desc = '%s - %s<br/><pre>' % (cs.author, cs.date)
105 desc += self.__changes(cs)
106
81 feed.add_item(title=cs.message,
107 feed.add_item(title=cs.message,
82 link=url('changeset_home', repo_name=repo_name,
108 link=url('changeset_home', repo_name=repo_name,
83 revision=cs.raw_id, qualified=True),
109 revision=cs.raw_id, qualified=True),
84 description=str(cs.date))
110 author_name=cs.author,
111 description=desc,
112 )
85
113
86 response.content_type = feed.mime_type
114 response.content_type = feed.mime_type
87 return feed.writeString('utf-8')
115 return feed.writeString('utf-8')
General Comments 0
You need to be logged in to leave comments. Login now