##// END OF EJS Templates
Implemented #661 Add option to include diff in RSS feed...
marcink -
r3028:30a22640 beta
parent child Browse files
Show More
@@ -65,6 +65,13 b' force_https = false'
65 65 commit_parse_limit = 25
66 66 use_gravatar = true
67 67
68 ## RSS feed options
69
70 rss_cut_off_limit = 256000
71 rss_items_per_page = 10
72 rss_include_diff = false
73
74
68 75 ## alternative_gravatar_url allows you to use your own avatar server application
69 76 ## the following parts of the URL will be replaced
70 77 ## {email} user email
@@ -65,6 +65,13 b' force_https = false'
65 65 commit_parse_limit = 50
66 66 use_gravatar = true
67 67
68 ## RSS feed options
69
70 rss_cut_off_limit = 256000
71 rss_items_per_page = 10
72 rss_include_diff = false
73
74
68 75 ## alternative_gravatar_url allows you to use your own avatar server application
69 76 ## the following parts of the URL will be replaced
70 77 ## {email} user email
@@ -65,6 +65,13 b' force_https = false'
65 65 commit_parse_limit = 50
66 66 use_gravatar = true
67 67
68 ## RSS feed options
69
70 rss_cut_off_limit = 256000
71 rss_items_per_page = 10
72 rss_include_diff = false
73
74
68 75 ## alternative_gravatar_url allows you to use your own avatar server application
69 76 ## the following parts of the URL will be replaced
70 77 ## {email} user email
@@ -36,6 +36,7 b' from rhodecode.lib.auth import LoginRequ'
36 36 from rhodecode.lib.base import BaseRepoController
37 37 from rhodecode.lib.diffs import DiffProcessor, LimitedDiffContainer
38 38 from rhodecode.model.db import CacheInvalidation
39 from rhodecode.lib.utils2 import safe_int, str2bool
39 40
40 41 log = logging.getLogger(__name__)
41 42
@@ -52,10 +53,13 b' class FeedController(BaseRepoController)'
52 53 self.title = self.title = _('%s %s feed') % (c.rhodecode_name, '%s')
53 54 self.language = 'en-us'
54 55 self.ttl = "5"
55 self.feed_nr = 20
56 import rhodecode
57 CONF = rhodecode.CONFIG
58 self.include_diff = str2bool(CONF.get('rss_include_diff', False))
59 self.feed_nr = safe_int(CONF.get('rss_items_per_page', 20))
56 60 # we need to protect from parsing huge diffs here other way
57 # we can kill the server, 32*1024 chars is a reasonable limit
58 self.feed_diff_limit = 32 * 1024
61 # we can kill the server
62 self.feed_diff_limit = safe_int(CONF.get('rss_cut_off_limit'), 32 * 1024)
59 63
60 64 def _get_title(self, cs):
61 65 return "%s" % (
@@ -80,7 +84,7 b' class FeedController(BaseRepoController)'
80 84 if limited_diff:
81 85 changes = changes + ['\n ' +
82 86 _('Changeset was too big and was cut off...')]
83 return changes
87 return diff_processor, changes
84 88
85 89 def __get_desc(self, cs):
86 90 desc_msg = []
@@ -95,6 +99,7 b' class FeedController(BaseRepoController)'
95 99 desc_msg.append('bookmark: %s<br/>' % book)
96 100 for tag in cs.tags:
97 101 desc_msg.append('tag: %s<br/>' % tag)
102 diff_processor, changes = self.__changes(cs)
98 103 # rev link
99 104 _url = url('changeset_home', repo_name=cs.repository.name,
100 105 revision=cs.raw_id, qualified=True)
@@ -103,7 +108,10 b' class FeedController(BaseRepoController)'
103 108 desc_msg.append('<pre>')
104 109 desc_msg.append(cs.message)
105 110 desc_msg.append('\n')
106 desc_msg.extend(self.__changes(cs))
111 desc_msg.extend(changes)
112 if self.include_diff:
113 desc_msg.append('\n\n')
114 desc_msg.append(diff_processor.as_raw())
107 115 desc_msg.append('</pre>')
108 116 return desc_msg
109 117
General Comments 0
You need to be logged in to leave comments. Login now