##// END OF EJS Templates
Don't clear dbsessions when celery_eager is turned on
marcink -
r2299:e2dbdaf1 beta
parent child Browse files
Show More
@@ -1,666 +1,669 b''
1 .. _changelog:
1 .. _changelog:
2
2
3 =========
3 =========
4 Changelog
4 Changelog
5 =========
5 =========
6
6
7 1.4.0 (**2012-XX-XX**)
7 1.4.0 (**2012-XX-XX**)
8 ----------------------
8 ----------------------
9
9
10 :status: in-progress
10 :status: in-progress
11 :branch: beta
11 :branch: beta
12
12
13 news
13 news
14 ++++
14 ++++
15
15
16 - new codereview system
16 - new codereview system
17 - changed setup-app into setup-rhodecode and added default options to it.
17 - changed setup-app into setup-rhodecode and added default options to it.
18
18
19 fixes
19 fixes
20 +++++
20 +++++
21
21
22
23
22 1.3.6 (**2012-05-17**)
24 1.3.6 (**2012-05-17**)
23 ----------------------
25 ----------------------
24
26
25 news
27 news
26 ++++
28 ++++
27
29
28 - chinese traditional translation
30 - chinese traditional translation
29 - changed setup-app into setup-rhodecode and added arguments for auto-setup
31 - changed setup-app into setup-rhodecode and added arguments for auto-setup
30 mode that doesn't need user interaction
32 mode that doesn't need user interaction
31
33
32 fixes
34 fixes
33 +++++
35 +++++
34
36
35 - fixed no scm found warning
37 - fixed no scm found warning
36 - fixed __future__ import error on rcextensions
38 - fixed __future__ import error on rcextensions
37 - made simplejson required lib for speedup on JSON encoding
39 - made simplejson required lib for speedup on JSON encoding
38 - fixes #449 bad regex could get more than revisions from parsing history
40 - fixes #449 bad regex could get more than revisions from parsing history
41 - don't clear DB session when CELERY_EAGER is turned ON
39
42
40 1.3.5 (**2012-05-10**)
43 1.3.5 (**2012-05-10**)
41 ----------------------
44 ----------------------
42
45
43 news
46 news
44 ++++
47 ++++
45
48
46 - use ext_json for json module
49 - use ext_json for json module
47 - unified annotation view with file source view
50 - unified annotation view with file source view
48 - notification improvements, better inbox + css
51 - notification improvements, better inbox + css
49 - #419 don't strip passwords for login forms, make rhodecode
52 - #419 don't strip passwords for login forms, make rhodecode
50 more compatible with LDAP servers
53 more compatible with LDAP servers
51 - Added HTTP_X_FORWARDED_FOR as another method of extracting
54 - Added HTTP_X_FORWARDED_FOR as another method of extracting
52 IP for pull/push logs. - moved all to base controller
55 IP for pull/push logs. - moved all to base controller
53 - #415: Adding comment to changeset causes reload.
56 - #415: Adding comment to changeset causes reload.
54 Comments are now added via ajax and doesn't reload the page
57 Comments are now added via ajax and doesn't reload the page
55 - #374 LDAP config is discarded when LDAP can't be activated
58 - #374 LDAP config is discarded when LDAP can't be activated
56 - limited push/pull operations are now logged for git in the journal
59 - limited push/pull operations are now logged for git in the journal
57 - bumped mercurial to 2.2.X series
60 - bumped mercurial to 2.2.X series
58 - added support for displaying submodules in file-browser
61 - added support for displaying submodules in file-browser
59 - #421 added bookmarks in changelog view
62 - #421 added bookmarks in changelog view
60
63
61 fixes
64 fixes
62 +++++
65 +++++
63
66
64 - fixed dev-version marker for stable when served from source codes
67 - fixed dev-version marker for stable when served from source codes
65 - fixed missing permission checks on show forks page
68 - fixed missing permission checks on show forks page
66 - #418 cast to unicode fixes in notification objects
69 - #418 cast to unicode fixes in notification objects
67 - #426 fixed mention extracting regex
70 - #426 fixed mention extracting regex
68 - fixed remote-pulling for git remotes remopositories
71 - fixed remote-pulling for git remotes remopositories
69 - fixed #434: Error when accessing files or changesets of a git repository
72 - fixed #434: Error when accessing files or changesets of a git repository
70 with submodules
73 with submodules
71 - fixed issue with empty APIKEYS for users after registration ref. #438
74 - fixed issue with empty APIKEYS for users after registration ref. #438
72 - fixed issue with getting README files from git repositories
75 - fixed issue with getting README files from git repositories
73
76
74 1.3.4 (**2012-03-28**)
77 1.3.4 (**2012-03-28**)
75 ----------------------
78 ----------------------
76
79
77 news
80 news
78 ++++
81 ++++
79
82
80 - Whoosh logging is now controlled by the .ini files logging setup
83 - Whoosh logging is now controlled by the .ini files logging setup
81 - added clone-url into edit form on /settings page
84 - added clone-url into edit form on /settings page
82 - added help text into repo add/edit forms
85 - added help text into repo add/edit forms
83 - created rcextensions module with additional mappings (ref #322) and
86 - created rcextensions module with additional mappings (ref #322) and
84 post push/pull/create repo hooks callbacks
87 post push/pull/create repo hooks callbacks
85 - implemented #377 Users view for his own permissions on account page
88 - implemented #377 Users view for his own permissions on account page
86 - #399 added inheritance of permissions for users group on repos groups
89 - #399 added inheritance of permissions for users group on repos groups
87 - #401 repository group is automatically pre-selected when adding repos
90 - #401 repository group is automatically pre-selected when adding repos
88 inside a repository group
91 inside a repository group
89 - added alternative HTTP 403 response when client failed to authenticate. Helps
92 - added alternative HTTP 403 response when client failed to authenticate. Helps
90 solving issues with Mercurial and LDAP
93 solving issues with Mercurial and LDAP
91 - #402 removed group prefix from repository name when listing repositories
94 - #402 removed group prefix from repository name when listing repositories
92 inside a group
95 inside a group
93 - added gravatars into permission view and permissions autocomplete
96 - added gravatars into permission view and permissions autocomplete
94 - #347 when running multiple RhodeCode instances, properly invalidates cache
97 - #347 when running multiple RhodeCode instances, properly invalidates cache
95 for all registered servers
98 for all registered servers
96
99
97 fixes
100 fixes
98 +++++
101 +++++
99
102
100 - fixed #390 cache invalidation problems on repos inside group
103 - fixed #390 cache invalidation problems on repos inside group
101 - fixed #385 clone by ID url was loosing proxy prefix in URL
104 - fixed #385 clone by ID url was loosing proxy prefix in URL
102 - fixed some unicode problems with waitress
105 - fixed some unicode problems with waitress
103 - fixed issue with escaping < and > in changeset commits
106 - fixed issue with escaping < and > in changeset commits
104 - fixed error occurring during recursive group creation in API
107 - fixed error occurring during recursive group creation in API
105 create_repo function
108 create_repo function
106 - fixed #393 py2.5 fixes for routes url generator
109 - fixed #393 py2.5 fixes for routes url generator
107 - fixed #397 Private repository groups shows up before login
110 - fixed #397 Private repository groups shows up before login
108 - fixed #396 fixed problems with revoking users in nested groups
111 - fixed #396 fixed problems with revoking users in nested groups
109 - fixed mysql unicode issues + specified InnoDB as default engine with
112 - fixed mysql unicode issues + specified InnoDB as default engine with
110 utf8 charset
113 utf8 charset
111 - #406 trim long branch/tag names in changelog to not break UI
114 - #406 trim long branch/tag names in changelog to not break UI
112
115
113 1.3.3 (**2012-03-02**)
116 1.3.3 (**2012-03-02**)
114 ----------------------
117 ----------------------
115
118
116 news
119 news
117 ++++
120 ++++
118
121
119
122
120 fixes
123 fixes
121 +++++
124 +++++
122
125
123 - fixed some python2.5 compatibility issues
126 - fixed some python2.5 compatibility issues
124 - fixed issues with removed repos was accidentally added as groups, after
127 - fixed issues with removed repos was accidentally added as groups, after
125 full rescan of paths
128 full rescan of paths
126 - fixes #376 Cannot edit user (using container auth)
129 - fixes #376 Cannot edit user (using container auth)
127 - fixes #378 Invalid image urls on changeset screen with proxy-prefix
130 - fixes #378 Invalid image urls on changeset screen with proxy-prefix
128 configuration
131 configuration
129 - fixed initial sorting of repos inside repo group
132 - fixed initial sorting of repos inside repo group
130 - fixes issue when user tried to resubmit same permission into user/user_groups
133 - fixes issue when user tried to resubmit same permission into user/user_groups
131 - bumped beaker version that fixes #375 leap error bug
134 - bumped beaker version that fixes #375 leap error bug
132 - fixed raw_changeset for git. It was generated with hg patch headers
135 - fixed raw_changeset for git. It was generated with hg patch headers
133 - fixed vcs issue with last_changeset for filenodes
136 - fixed vcs issue with last_changeset for filenodes
134 - fixed missing commit after hook delete
137 - fixed missing commit after hook delete
135 - fixed #372 issues with git operation detection that caused a security issue
138 - fixed #372 issues with git operation detection that caused a security issue
136 for git repos
139 for git repos
137
140
138 1.3.2 (**2012-02-28**)
141 1.3.2 (**2012-02-28**)
139 ----------------------
142 ----------------------
140
143
141 news
144 news
142 ++++
145 ++++
143
146
144
147
145 fixes
148 fixes
146 +++++
149 +++++
147
150
148 - fixed git protocol issues with repos-groups
151 - fixed git protocol issues with repos-groups
149 - fixed git remote repos validator that prevented from cloning remote git repos
152 - fixed git remote repos validator that prevented from cloning remote git repos
150 - fixes #370 ending slashes fixes for repo and groups
153 - fixes #370 ending slashes fixes for repo and groups
151 - fixes #368 improved git-protocol detection to handle other clients
154 - fixes #368 improved git-protocol detection to handle other clients
152 - fixes #366 When Setting Repository Group To Blank Repo Group Wont Be
155 - fixes #366 When Setting Repository Group To Blank Repo Group Wont Be
153 Moved To Root
156 Moved To Root
154 - fixes #371 fixed issues with beaker/sqlalchemy and non-ascii cache keys
157 - fixes #371 fixed issues with beaker/sqlalchemy and non-ascii cache keys
155 - fixed #373 missing cascade drop on user_group_to_perm table
158 - fixed #373 missing cascade drop on user_group_to_perm table
156
159
157 1.3.1 (**2012-02-27**)
160 1.3.1 (**2012-02-27**)
158 ----------------------
161 ----------------------
159
162
160 news
163 news
161 ++++
164 ++++
162
165
163
166
164 fixes
167 fixes
165 +++++
168 +++++
166
169
167 - redirection loop occurs when remember-me wasn't checked during login
170 - redirection loop occurs when remember-me wasn't checked during login
168 - fixes issues with git blob history generation
171 - fixes issues with git blob history generation
169 - don't fetch branch for git in file history dropdown. Causes unneeded slowness
172 - don't fetch branch for git in file history dropdown. Causes unneeded slowness
170
173
171 1.3.0 (**2012-02-26**)
174 1.3.0 (**2012-02-26**)
172 ----------------------
175 ----------------------
173
176
174 news
177 news
175 ++++
178 ++++
176
179
177 - code review, inspired by github code-comments
180 - code review, inspired by github code-comments
178 - #215 rst and markdown README files support
181 - #215 rst and markdown README files support
179 - #252 Container-based and proxy pass-through authentication support
182 - #252 Container-based and proxy pass-through authentication support
180 - #44 branch browser. Filtering of changelog by branches
183 - #44 branch browser. Filtering of changelog by branches
181 - mercurial bookmarks support
184 - mercurial bookmarks support
182 - new hover top menu, optimized to add maximum size for important views
185 - new hover top menu, optimized to add maximum size for important views
183 - configurable clone url template with possibility to specify protocol like
186 - configurable clone url template with possibility to specify protocol like
184 ssh:// or http:// and also manually alter other parts of clone_url.
187 ssh:// or http:// and also manually alter other parts of clone_url.
185 - enabled largefiles extension by default
188 - enabled largefiles extension by default
186 - optimized summary file pages and saved a lot of unused space in them
189 - optimized summary file pages and saved a lot of unused space in them
187 - #239 option to manually mark repository as fork
190 - #239 option to manually mark repository as fork
188 - #320 mapping of commit authors to RhodeCode users
191 - #320 mapping of commit authors to RhodeCode users
189 - #304 hashes are displayed using monospace font
192 - #304 hashes are displayed using monospace font
190 - diff configuration, toggle white lines and context lines
193 - diff configuration, toggle white lines and context lines
191 - #307 configurable diffs, whitespace toggle, increasing context lines
194 - #307 configurable diffs, whitespace toggle, increasing context lines
192 - sorting on branches, tags and bookmarks using YUI datatable
195 - sorting on branches, tags and bookmarks using YUI datatable
193 - improved file filter on files page
196 - improved file filter on files page
194 - implements #330 api method for listing nodes ar particular revision
197 - implements #330 api method for listing nodes ar particular revision
195 - #73 added linking issues in commit messages to chosen issue tracker url
198 - #73 added linking issues in commit messages to chosen issue tracker url
196 based on user defined regular expression
199 based on user defined regular expression
197 - added linking of changesets in commit messages
200 - added linking of changesets in commit messages
198 - new compact changelog with expandable commit messages
201 - new compact changelog with expandable commit messages
199 - firstname and lastname are optional in user creation
202 - firstname and lastname are optional in user creation
200 - #348 added post-create repository hook
203 - #348 added post-create repository hook
201 - #212 global encoding settings is now configurable from .ini files
204 - #212 global encoding settings is now configurable from .ini files
202 - #227 added repository groups permissions
205 - #227 added repository groups permissions
203 - markdown gets codehilite extensions
206 - markdown gets codehilite extensions
204 - new API methods, delete_repositories, grante/revoke permissions for groups
207 - new API methods, delete_repositories, grante/revoke permissions for groups
205 and repos
208 and repos
206
209
207
210
208 fixes
211 fixes
209 +++++
212 +++++
210
213
211 - rewrote dbsession management for atomic operations, and better error handling
214 - rewrote dbsession management for atomic operations, and better error handling
212 - fixed sorting of repo tables
215 - fixed sorting of repo tables
213 - #326 escape of special html entities in diffs
216 - #326 escape of special html entities in diffs
214 - normalized user_name => username in api attributes
217 - normalized user_name => username in api attributes
215 - fixes #298 ldap created users with mixed case emails created conflicts
218 - fixes #298 ldap created users with mixed case emails created conflicts
216 on saving a form
219 on saving a form
217 - fixes issue when owner of a repo couldn't revoke permissions for users
220 - fixes issue when owner of a repo couldn't revoke permissions for users
218 and groups
221 and groups
219 - fixes #271 rare JSON serialization problem with statistics
222 - fixes #271 rare JSON serialization problem with statistics
220 - fixes #337 missing validation check for conflicting names of a group with a
223 - fixes #337 missing validation check for conflicting names of a group with a
221 repositories group
224 repositories group
222 - #340 fixed session problem for mysql and celery tasks
225 - #340 fixed session problem for mysql and celery tasks
223 - fixed #331 RhodeCode mangles repository names if the a repository group
226 - fixed #331 RhodeCode mangles repository names if the a repository group
224 contains the "full path" to the repositories
227 contains the "full path" to the repositories
225 - #355 RhodeCode doesn't store encrypted LDAP passwords
228 - #355 RhodeCode doesn't store encrypted LDAP passwords
226
229
227 1.2.5 (**2012-01-28**)
230 1.2.5 (**2012-01-28**)
228 ----------------------
231 ----------------------
229
232
230 news
233 news
231 ++++
234 ++++
232
235
233 fixes
236 fixes
234 +++++
237 +++++
235
238
236 - #340 Celery complains about MySQL server gone away, added session cleanup
239 - #340 Celery complains about MySQL server gone away, added session cleanup
237 for celery tasks
240 for celery tasks
238 - #341 "scanning for repositories in None" log message during Rescan was missing
241 - #341 "scanning for repositories in None" log message during Rescan was missing
239 a parameter
242 a parameter
240 - fixed creating archives with subrepos. Some hooks were triggered during that
243 - fixed creating archives with subrepos. Some hooks were triggered during that
241 operation leading to crash.
244 operation leading to crash.
242 - fixed missing email in account page.
245 - fixed missing email in account page.
243 - Reverted Mercurial to 2.0.1 for windows due to bug in Mercurial that makes
246 - Reverted Mercurial to 2.0.1 for windows due to bug in Mercurial that makes
244 forking on windows impossible
247 forking on windows impossible
245
248
246 1.2.4 (**2012-01-19**)
249 1.2.4 (**2012-01-19**)
247 ----------------------
250 ----------------------
248
251
249 news
252 news
250 ++++
253 ++++
251
254
252 - RhodeCode is bundled with mercurial series 2.0.X by default, with
255 - RhodeCode is bundled with mercurial series 2.0.X by default, with
253 full support to largefiles extension. Enabled by default in new installations
256 full support to largefiles extension. Enabled by default in new installations
254 - #329 Ability to Add/Remove Groups to/from a Repository via AP
257 - #329 Ability to Add/Remove Groups to/from a Repository via AP
255 - added requires.txt file with requirements
258 - added requires.txt file with requirements
256
259
257 fixes
260 fixes
258 +++++
261 +++++
259
262
260 - fixes db session issues with celery when emailing admins
263 - fixes db session issues with celery when emailing admins
261 - #331 RhodeCode mangles repository names if the a repository group
264 - #331 RhodeCode mangles repository names if the a repository group
262 contains the "full path" to the repositories
265 contains the "full path" to the repositories
263 - #298 Conflicting e-mail addresses for LDAP and RhodeCode users
266 - #298 Conflicting e-mail addresses for LDAP and RhodeCode users
264 - DB session cleanup after hg protocol operations, fixes issues with
267 - DB session cleanup after hg protocol operations, fixes issues with
265 `mysql has gone away` errors
268 `mysql has gone away` errors
266 - #333 doc fixes for get_repo api function
269 - #333 doc fixes for get_repo api function
267 - #271 rare JSON serialization problem with statistics enabled
270 - #271 rare JSON serialization problem with statistics enabled
268 - #337 Fixes issues with validation of repository name conflicting with
271 - #337 Fixes issues with validation of repository name conflicting with
269 a group name. A proper message is now displayed.
272 a group name. A proper message is now displayed.
270 - #292 made ldap_dn in user edit readonly, to get rid of confusion that field
273 - #292 made ldap_dn in user edit readonly, to get rid of confusion that field
271 doesn't work
274 doesn't work
272 - #316 fixes issues with web description in hgrc files
275 - #316 fixes issues with web description in hgrc files
273
276
274 1.2.3 (**2011-11-02**)
277 1.2.3 (**2011-11-02**)
275 ----------------------
278 ----------------------
276
279
277 news
280 news
278 ++++
281 ++++
279
282
280 - added option to manage repos group for non admin users
283 - added option to manage repos group for non admin users
281 - added following API methods for get_users, create_user, get_users_groups,
284 - added following API methods for get_users, create_user, get_users_groups,
282 get_users_group, create_users_group, add_user_to_users_groups, get_repos,
285 get_users_group, create_users_group, add_user_to_users_groups, get_repos,
283 get_repo, create_repo, add_user_to_repo
286 get_repo, create_repo, add_user_to_repo
284 - implements #237 added password confirmation for my account
287 - implements #237 added password confirmation for my account
285 and admin edit user.
288 and admin edit user.
286 - implements #291 email notification for global events are now sent to all
289 - implements #291 email notification for global events are now sent to all
287 administrator users, and global config email.
290 administrator users, and global config email.
288
291
289 fixes
292 fixes
290 +++++
293 +++++
291
294
292 - added option for passing auth method for smtp mailer
295 - added option for passing auth method for smtp mailer
293 - #276 issue with adding a single user with id>10 to usergroups
296 - #276 issue with adding a single user with id>10 to usergroups
294 - #277 fixes windows LDAP settings in which missing values breaks the ldap auth
297 - #277 fixes windows LDAP settings in which missing values breaks the ldap auth
295 - #288 fixes managing of repos in a group for non admin user
298 - #288 fixes managing of repos in a group for non admin user
296
299
297 1.2.2 (**2011-10-17**)
300 1.2.2 (**2011-10-17**)
298 ----------------------
301 ----------------------
299
302
300 news
303 news
301 ++++
304 ++++
302
305
303 - #226 repo groups are available by path instead of numerical id
306 - #226 repo groups are available by path instead of numerical id
304
307
305 fixes
308 fixes
306 +++++
309 +++++
307
310
308 - #259 Groups with the same name but with different parent group
311 - #259 Groups with the same name but with different parent group
309 - #260 Put repo in group, then move group to another group -> repo becomes unavailable
312 - #260 Put repo in group, then move group to another group -> repo becomes unavailable
310 - #258 RhodeCode 1.2 assumes egg folder is writable (lockfiles problems)
313 - #258 RhodeCode 1.2 assumes egg folder is writable (lockfiles problems)
311 - #265 ldap save fails sometimes on converting attributes to booleans,
314 - #265 ldap save fails sometimes on converting attributes to booleans,
312 added getter and setter into model that will prevent from this on db model level
315 added getter and setter into model that will prevent from this on db model level
313 - fixed problems with timestamps issues #251 and #213
316 - fixed problems with timestamps issues #251 and #213
314 - fixes #266 RhodeCode allows to create repo with the same name and in
317 - fixes #266 RhodeCode allows to create repo with the same name and in
315 the same parent as group
318 the same parent as group
316 - fixes #245 Rescan of the repositories on Windows
319 - fixes #245 Rescan of the repositories on Windows
317 - fixes #248 cannot edit repos inside a group on windows
320 - fixes #248 cannot edit repos inside a group on windows
318 - fixes #219 forking problems on windows
321 - fixes #219 forking problems on windows
319
322
320 1.2.1 (**2011-10-08**)
323 1.2.1 (**2011-10-08**)
321 ----------------------
324 ----------------------
322
325
323 news
326 news
324 ++++
327 ++++
325
328
326
329
327 fixes
330 fixes
328 +++++
331 +++++
329
332
330 - fixed problems with basic auth and push problems
333 - fixed problems with basic auth and push problems
331 - gui fixes
334 - gui fixes
332 - fixed logger
335 - fixed logger
333
336
334 1.2.0 (**2011-10-07**)
337 1.2.0 (**2011-10-07**)
335 ----------------------
338 ----------------------
336
339
337 news
340 news
338 ++++
341 ++++
339
342
340 - implemented #47 repository groups
343 - implemented #47 repository groups
341 - implemented #89 Can setup google analytics code from settings menu
344 - implemented #89 Can setup google analytics code from settings menu
342 - implemented #91 added nicer looking archive urls with more download options
345 - implemented #91 added nicer looking archive urls with more download options
343 like tags, branches
346 like tags, branches
344 - implemented #44 into file browsing, and added follow branch option
347 - implemented #44 into file browsing, and added follow branch option
345 - implemented #84 downloads can be enabled/disabled for each repository
348 - implemented #84 downloads can be enabled/disabled for each repository
346 - anonymous repository can be cloned without having to pass default:default
349 - anonymous repository can be cloned without having to pass default:default
347 into clone url
350 into clone url
348 - fixed #90 whoosh indexer can index chooses repositories passed in command
351 - fixed #90 whoosh indexer can index chooses repositories passed in command
349 line
352 line
350 - extended journal with day aggregates and paging
353 - extended journal with day aggregates and paging
351 - implemented #107 source code lines highlight ranges
354 - implemented #107 source code lines highlight ranges
352 - implemented #93 customizable changelog on combined revision ranges -
355 - implemented #93 customizable changelog on combined revision ranges -
353 equivalent of githubs compare view
356 equivalent of githubs compare view
354 - implemented #108 extended and more powerful LDAP configuration
357 - implemented #108 extended and more powerful LDAP configuration
355 - implemented #56 users groups
358 - implemented #56 users groups
356 - major code rewrites optimized codes for speed and memory usage
359 - major code rewrites optimized codes for speed and memory usage
357 - raw and diff downloads are now in git format
360 - raw and diff downloads are now in git format
358 - setup command checks for write access to given path
361 - setup command checks for write access to given path
359 - fixed many issues with international characters and unicode. It uses utf8
362 - fixed many issues with international characters and unicode. It uses utf8
360 decode with replace to provide less errors even with non utf8 encoded strings
363 decode with replace to provide less errors even with non utf8 encoded strings
361 - #125 added API KEY access to feeds
364 - #125 added API KEY access to feeds
362 - #109 Repository can be created from external Mercurial link (aka. remote
365 - #109 Repository can be created from external Mercurial link (aka. remote
363 repository, and manually updated (via pull) from admin panel
366 repository, and manually updated (via pull) from admin panel
364 - beta git support - push/pull server + basic view for git repos
367 - beta git support - push/pull server + basic view for git repos
365 - added followers page and forks page
368 - added followers page and forks page
366 - server side file creation (with binary file upload interface)
369 - server side file creation (with binary file upload interface)
367 and edition with commits powered by codemirror
370 and edition with commits powered by codemirror
368 - #111 file browser file finder, quick lookup files on whole file tree
371 - #111 file browser file finder, quick lookup files on whole file tree
369 - added quick login sliding menu into main page
372 - added quick login sliding menu into main page
370 - changelog uses lazy loading of affected files details, in some scenarios
373 - changelog uses lazy loading of affected files details, in some scenarios
371 this can improve speed of changelog page dramatically especially for
374 this can improve speed of changelog page dramatically especially for
372 larger repositories.
375 larger repositories.
373 - implements #214 added support for downloading subrepos in download menu.
376 - implements #214 added support for downloading subrepos in download menu.
374 - Added basic API for direct operations on rhodecode via JSON
377 - Added basic API for direct operations on rhodecode via JSON
375 - Implemented advanced hook management
378 - Implemented advanced hook management
376
379
377 fixes
380 fixes
378 +++++
381 +++++
379
382
380 - fixed file browser bug, when switching into given form revision the url was
383 - fixed file browser bug, when switching into given form revision the url was
381 not changing
384 not changing
382 - fixed propagation to error controller on simplehg and simplegit middlewares
385 - fixed propagation to error controller on simplehg and simplegit middlewares
383 - fixed error when trying to make a download on empty repository
386 - fixed error when trying to make a download on empty repository
384 - fixed problem with '[' chars in commit messages in journal
387 - fixed problem with '[' chars in commit messages in journal
385 - fixed #99 Unicode errors, on file node paths with non utf-8 characters
388 - fixed #99 Unicode errors, on file node paths with non utf-8 characters
386 - journal fork fixes
389 - journal fork fixes
387 - removed issue with space inside renamed repository after deletion
390 - removed issue with space inside renamed repository after deletion
388 - fixed strange issue on formencode imports
391 - fixed strange issue on formencode imports
389 - fixed #126 Deleting repository on Windows, rename used incompatible chars.
392 - fixed #126 Deleting repository on Windows, rename used incompatible chars.
390 - #150 fixes for errors on repositories mapped in db but corrupted in
393 - #150 fixes for errors on repositories mapped in db but corrupted in
391 filesystem
394 filesystem
392 - fixed problem with ascendant characters in realm #181
395 - fixed problem with ascendant characters in realm #181
393 - fixed problem with sqlite file based database connection pool
396 - fixed problem with sqlite file based database connection pool
394 - whoosh indexer and code stats share the same dynamic extensions map
397 - whoosh indexer and code stats share the same dynamic extensions map
395 - fixes #188 - relationship delete of repo_to_perm entry on user removal
398 - fixes #188 - relationship delete of repo_to_perm entry on user removal
396 - fixes issue #189 Trending source files shows "show more" when no more exist
399 - fixes issue #189 Trending source files shows "show more" when no more exist
397 - fixes issue #197 Relative paths for pidlocks
400 - fixes issue #197 Relative paths for pidlocks
398 - fixes issue #198 password will require only 3 chars now for login form
401 - fixes issue #198 password will require only 3 chars now for login form
399 - fixes issue #199 wrong redirection for non admin users after creating a repository
402 - fixes issue #199 wrong redirection for non admin users after creating a repository
400 - fixes issues #202, bad db constraint made impossible to attach same group
403 - fixes issues #202, bad db constraint made impossible to attach same group
401 more than one time. Affects only mysql/postgres
404 more than one time. Affects only mysql/postgres
402 - fixes #218 os.kill patch for windows was missing sig param
405 - fixes #218 os.kill patch for windows was missing sig param
403 - improved rendering of dag (they are not trimmed anymore when number of
406 - improved rendering of dag (they are not trimmed anymore when number of
404 heads exceeds 5)
407 heads exceeds 5)
405
408
406 1.1.8 (**2011-04-12**)
409 1.1.8 (**2011-04-12**)
407 ----------------------
410 ----------------------
408
411
409 news
412 news
410 ++++
413 ++++
411
414
412 - improved windows support
415 - improved windows support
413
416
414 fixes
417 fixes
415 +++++
418 +++++
416
419
417 - fixed #140 freeze of python dateutil library, since new version is python2.x
420 - fixed #140 freeze of python dateutil library, since new version is python2.x
418 incompatible
421 incompatible
419 - setup-app will check for write permission in given path
422 - setup-app will check for write permission in given path
420 - cleaned up license info issue #149
423 - cleaned up license info issue #149
421 - fixes for issues #137,#116 and problems with unicode and accented characters.
424 - fixes for issues #137,#116 and problems with unicode and accented characters.
422 - fixes crashes on gravatar, when passed in email as unicode
425 - fixes crashes on gravatar, when passed in email as unicode
423 - fixed tooltip flickering problems
426 - fixed tooltip flickering problems
424 - fixed came_from redirection on windows
427 - fixed came_from redirection on windows
425 - fixed logging modules, and sql formatters
428 - fixed logging modules, and sql formatters
426 - windows fixes for os.kill issue #133
429 - windows fixes for os.kill issue #133
427 - fixes path splitting for windows issues #148
430 - fixes path splitting for windows issues #148
428 - fixed issue #143 wrong import on migration to 1.1.X
431 - fixed issue #143 wrong import on migration to 1.1.X
429 - fixed problems with displaying binary files, thanks to Thomas Waldmann
432 - fixed problems with displaying binary files, thanks to Thomas Waldmann
430 - removed name from archive files since it's breaking ui for long repo names
433 - removed name from archive files since it's breaking ui for long repo names
431 - fixed issue with archive headers sent to browser, thanks to Thomas Waldmann
434 - fixed issue with archive headers sent to browser, thanks to Thomas Waldmann
432 - fixed compatibility for 1024px displays, and larger dpi settings, thanks to
435 - fixed compatibility for 1024px displays, and larger dpi settings, thanks to
433 Thomas Waldmann
436 Thomas Waldmann
434 - fixed issue #166 summary pager was skipping 10 revisions on second page
437 - fixed issue #166 summary pager was skipping 10 revisions on second page
435
438
436
439
437 1.1.7 (**2011-03-23**)
440 1.1.7 (**2011-03-23**)
438 ----------------------
441 ----------------------
439
442
440 news
443 news
441 ++++
444 ++++
442
445
443 fixes
446 fixes
444 +++++
447 +++++
445
448
446 - fixed (again) #136 installation support for FreeBSD
449 - fixed (again) #136 installation support for FreeBSD
447
450
448
451
449 1.1.6 (**2011-03-21**)
452 1.1.6 (**2011-03-21**)
450 ----------------------
453 ----------------------
451
454
452 news
455 news
453 ++++
456 ++++
454
457
455 fixes
458 fixes
456 +++++
459 +++++
457
460
458 - fixed #136 installation support for FreeBSD
461 - fixed #136 installation support for FreeBSD
459 - RhodeCode will check for python version during installation
462 - RhodeCode will check for python version during installation
460
463
461 1.1.5 (**2011-03-17**)
464 1.1.5 (**2011-03-17**)
462 ----------------------
465 ----------------------
463
466
464 news
467 news
465 ++++
468 ++++
466
469
467 - basic windows support, by exchanging pybcrypt into sha256 for windows only
470 - basic windows support, by exchanging pybcrypt into sha256 for windows only
468 highly inspired by idea of mantis406
471 highly inspired by idea of mantis406
469
472
470 fixes
473 fixes
471 +++++
474 +++++
472
475
473 - fixed sorting by author in main page
476 - fixed sorting by author in main page
474 - fixed crashes with diffs on binary files
477 - fixed crashes with diffs on binary files
475 - fixed #131 problem with boolean values for LDAP
478 - fixed #131 problem with boolean values for LDAP
476 - fixed #122 mysql problems thanks to striker69
479 - fixed #122 mysql problems thanks to striker69
477 - fixed problem with errors on calling raw/raw_files/annotate functions
480 - fixed problem with errors on calling raw/raw_files/annotate functions
478 with unknown revisions
481 with unknown revisions
479 - fixed returned rawfiles attachment names with international character
482 - fixed returned rawfiles attachment names with international character
480 - cleaned out docs, big thanks to Jason Harris
483 - cleaned out docs, big thanks to Jason Harris
481
484
482 1.1.4 (**2011-02-19**)
485 1.1.4 (**2011-02-19**)
483 ----------------------
486 ----------------------
484
487
485 news
488 news
486 ++++
489 ++++
487
490
488 fixes
491 fixes
489 +++++
492 +++++
490
493
491 - fixed formencode import problem on settings page, that caused server crash
494 - fixed formencode import problem on settings page, that caused server crash
492 when that page was accessed as first after server start
495 when that page was accessed as first after server start
493 - journal fixes
496 - journal fixes
494 - fixed option to access repository just by entering http://server/<repo_name>
497 - fixed option to access repository just by entering http://server/<repo_name>
495
498
496 1.1.3 (**2011-02-16**)
499 1.1.3 (**2011-02-16**)
497 ----------------------
500 ----------------------
498
501
499 news
502 news
500 ++++
503 ++++
501
504
502 - implemented #102 allowing the '.' character in username
505 - implemented #102 allowing the '.' character in username
503 - added option to access repository just by entering http://server/<repo_name>
506 - added option to access repository just by entering http://server/<repo_name>
504 - celery task ignores result for better performance
507 - celery task ignores result for better performance
505
508
506 fixes
509 fixes
507 +++++
510 +++++
508
511
509 - fixed ehlo command and non auth mail servers on smtp_lib. Thanks to
512 - fixed ehlo command and non auth mail servers on smtp_lib. Thanks to
510 apollo13 and Johan Walles
513 apollo13 and Johan Walles
511 - small fixes in journal
514 - small fixes in journal
512 - fixed problems with getting setting for celery from .ini files
515 - fixed problems with getting setting for celery from .ini files
513 - registration, password reset and login boxes share the same title as main
516 - registration, password reset and login boxes share the same title as main
514 application now
517 application now
515 - fixed #113: to high permissions to fork repository
518 - fixed #113: to high permissions to fork repository
516 - fixed problem with '[' chars in commit messages in journal
519 - fixed problem with '[' chars in commit messages in journal
517 - removed issue with space inside renamed repository after deletion
520 - removed issue with space inside renamed repository after deletion
518 - db transaction fixes when filesystem repository creation failed
521 - db transaction fixes when filesystem repository creation failed
519 - fixed #106 relation issues on databases different than sqlite
522 - fixed #106 relation issues on databases different than sqlite
520 - fixed static files paths links to use of url() method
523 - fixed static files paths links to use of url() method
521
524
522 1.1.2 (**2011-01-12**)
525 1.1.2 (**2011-01-12**)
523 ----------------------
526 ----------------------
524
527
525 news
528 news
526 ++++
529 ++++
527
530
528
531
529 fixes
532 fixes
530 +++++
533 +++++
531
534
532 - fixes #98 protection against float division of percentage stats
535 - fixes #98 protection against float division of percentage stats
533 - fixed graph bug
536 - fixed graph bug
534 - forced webhelpers version since it was making troubles during installation
537 - forced webhelpers version since it was making troubles during installation
535
538
536 1.1.1 (**2011-01-06**)
539 1.1.1 (**2011-01-06**)
537 ----------------------
540 ----------------------
538
541
539 news
542 news
540 ++++
543 ++++
541
544
542 - added force https option into ini files for easier https usage (no need to
545 - added force https option into ini files for easier https usage (no need to
543 set server headers with this options)
546 set server headers with this options)
544 - small css updates
547 - small css updates
545
548
546 fixes
549 fixes
547 +++++
550 +++++
548
551
549 - fixed #96 redirect loop on files view on repositories without changesets
552 - fixed #96 redirect loop on files view on repositories without changesets
550 - fixed #97 unicode string passed into server header in special cases (mod_wsgi)
553 - fixed #97 unicode string passed into server header in special cases (mod_wsgi)
551 and server crashed with errors
554 and server crashed with errors
552 - fixed large tooltips problems on main page
555 - fixed large tooltips problems on main page
553 - fixed #92 whoosh indexer is more error proof
556 - fixed #92 whoosh indexer is more error proof
554
557
555 1.1.0 (**2010-12-18**)
558 1.1.0 (**2010-12-18**)
556 ----------------------
559 ----------------------
557
560
558 news
561 news
559 ++++
562 ++++
560
563
561 - rewrite of internals for vcs >=0.1.10
564 - rewrite of internals for vcs >=0.1.10
562 - uses mercurial 1.7 with dotencode disabled for maintaining compatibility
565 - uses mercurial 1.7 with dotencode disabled for maintaining compatibility
563 with older clients
566 with older clients
564 - anonymous access, authentication via ldap
567 - anonymous access, authentication via ldap
565 - performance upgrade for cached repos list - each repository has its own
568 - performance upgrade for cached repos list - each repository has its own
566 cache that's invalidated when needed.
569 cache that's invalidated when needed.
567 - performance upgrades on repositories with large amount of commits (20K+)
570 - performance upgrades on repositories with large amount of commits (20K+)
568 - main page quick filter for filtering repositories
571 - main page quick filter for filtering repositories
569 - user dashboards with ability to follow chosen repositories actions
572 - user dashboards with ability to follow chosen repositories actions
570 - sends email to admin on new user registration
573 - sends email to admin on new user registration
571 - added cache/statistics reset options into repository settings
574 - added cache/statistics reset options into repository settings
572 - more detailed action logger (based on hooks) with pushed changesets lists
575 - more detailed action logger (based on hooks) with pushed changesets lists
573 and options to disable those hooks from admin panel
576 and options to disable those hooks from admin panel
574 - introduced new enhanced changelog for merges that shows more accurate results
577 - introduced new enhanced changelog for merges that shows more accurate results
575 - new improved and faster code stats (based on pygments lexers mapping tables,
578 - new improved and faster code stats (based on pygments lexers mapping tables,
576 showing up to 10 trending sources for each repository. Additionally stats
579 showing up to 10 trending sources for each repository. Additionally stats
577 can be disabled in repository settings.
580 can be disabled in repository settings.
578 - gui optimizations, fixed application width to 1024px
581 - gui optimizations, fixed application width to 1024px
579 - added cut off (for large files/changesets) limit into config files
582 - added cut off (for large files/changesets) limit into config files
580 - whoosh, celeryd, upgrade moved to paster command
583 - whoosh, celeryd, upgrade moved to paster command
581 - other than sqlite database backends can be used
584 - other than sqlite database backends can be used
582
585
583 fixes
586 fixes
584 +++++
587 +++++
585
588
586 - fixes #61 forked repo was showing only after cache expired
589 - fixes #61 forked repo was showing only after cache expired
587 - fixes #76 no confirmation on user deletes
590 - fixes #76 no confirmation on user deletes
588 - fixes #66 Name field misspelled
591 - fixes #66 Name field misspelled
589 - fixes #72 block user removal when he owns repositories
592 - fixes #72 block user removal when he owns repositories
590 - fixes #69 added password confirmation fields
593 - fixes #69 added password confirmation fields
591 - fixes #87 RhodeCode crashes occasionally on updating repository owner
594 - fixes #87 RhodeCode crashes occasionally on updating repository owner
592 - fixes #82 broken annotations on files with more than 1 blank line at the end
595 - fixes #82 broken annotations on files with more than 1 blank line at the end
593 - a lot of fixes and tweaks for file browser
596 - a lot of fixes and tweaks for file browser
594 - fixed detached session issues
597 - fixed detached session issues
595 - fixed when user had no repos he would see all repos listed in my account
598 - fixed when user had no repos he would see all repos listed in my account
596 - fixed ui() instance bug when global hgrc settings was loaded for server
599 - fixed ui() instance bug when global hgrc settings was loaded for server
597 instance and all hgrc options were merged with our db ui() object
600 instance and all hgrc options were merged with our db ui() object
598 - numerous small bugfixes
601 - numerous small bugfixes
599
602
600 (special thanks for TkSoh for detailed feedback)
603 (special thanks for TkSoh for detailed feedback)
601
604
602
605
603 1.0.2 (**2010-11-12**)
606 1.0.2 (**2010-11-12**)
604 ----------------------
607 ----------------------
605
608
606 news
609 news
607 ++++
610 ++++
608
611
609 - tested under python2.7
612 - tested under python2.7
610 - bumped sqlalchemy and celery versions
613 - bumped sqlalchemy and celery versions
611
614
612 fixes
615 fixes
613 +++++
616 +++++
614
617
615 - fixed #59 missing graph.js
618 - fixed #59 missing graph.js
616 - fixed repo_size crash when repository had broken symlinks
619 - fixed repo_size crash when repository had broken symlinks
617 - fixed python2.5 crashes.
620 - fixed python2.5 crashes.
618
621
619
622
620 1.0.1 (**2010-11-10**)
623 1.0.1 (**2010-11-10**)
621 ----------------------
624 ----------------------
622
625
623 news
626 news
624 ++++
627 ++++
625
628
626 - small css updated
629 - small css updated
627
630
628 fixes
631 fixes
629 +++++
632 +++++
630
633
631 - fixed #53 python2.5 incompatible enumerate calls
634 - fixed #53 python2.5 incompatible enumerate calls
632 - fixed #52 disable mercurial extension for web
635 - fixed #52 disable mercurial extension for web
633 - fixed #51 deleting repositories don't delete it's dependent objects
636 - fixed #51 deleting repositories don't delete it's dependent objects
634
637
635
638
636 1.0.0 (**2010-11-02**)
639 1.0.0 (**2010-11-02**)
637 ----------------------
640 ----------------------
638
641
639 - security bugfix simplehg wasn't checking for permissions on commands
642 - security bugfix simplehg wasn't checking for permissions on commands
640 other than pull or push.
643 other than pull or push.
641 - fixed doubled messages after push or pull in admin journal
644 - fixed doubled messages after push or pull in admin journal
642 - templating and css corrections, fixed repo switcher on chrome, updated titles
645 - templating and css corrections, fixed repo switcher on chrome, updated titles
643 - admin menu accessible from options menu on repository view
646 - admin menu accessible from options menu on repository view
644 - permissions cached queries
647 - permissions cached queries
645
648
646 1.0.0rc4 (**2010-10-12**)
649 1.0.0rc4 (**2010-10-12**)
647 --------------------------
650 --------------------------
648
651
649 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
652 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
650 - removed cache_manager settings from sqlalchemy meta
653 - removed cache_manager settings from sqlalchemy meta
651 - added sqlalchemy cache settings to ini files
654 - added sqlalchemy cache settings to ini files
652 - validated password length and added second try of failure on paster setup-app
655 - validated password length and added second try of failure on paster setup-app
653 - fixed setup database destroy prompt even when there was no db
656 - fixed setup database destroy prompt even when there was no db
654
657
655
658
656 1.0.0rc3 (**2010-10-11**)
659 1.0.0rc3 (**2010-10-11**)
657 -------------------------
660 -------------------------
658
661
659 - fixed i18n during installation.
662 - fixed i18n during installation.
660
663
661 1.0.0rc2 (**2010-10-11**)
664 1.0.0rc2 (**2010-10-11**)
662 -------------------------
665 -------------------------
663
666
664 - Disabled dirsize in file browser, it's causing nasty bug when dir renames
667 - Disabled dirsize in file browser, it's causing nasty bug when dir renames
665 occure. After vcs is fixed it'll be put back again.
668 occure. After vcs is fixed it'll be put back again.
666 - templating/css rewrites, optimized css. No newline at end of file
669 - templating/css rewrites, optimized css.
@@ -1,97 +1,98 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 rhodecode.__init__
3 rhodecode.__init__
4 ~~~~~~~~~~~~~~~~~~
4 ~~~~~~~~~~~~~~~~~~
5
5
6 RhodeCode, a web based repository management based on pylons
6 RhodeCode, a web based repository management based on pylons
7 versioning implementation: http://www.python.org/dev/peps/pep-0386/
7 versioning implementation: http://www.python.org/dev/peps/pep-0386/
8
8
9 :created_on: Apr 9, 2010
9 :created_on: Apr 9, 2010
10 :author: marcink
10 :author: marcink
11 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
11 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
12 :license: GPLv3, see COPYING for more details.
12 :license: GPLv3, see COPYING for more details.
13 """
13 """
14 # This program is free software: you can redistribute it and/or modify
14 # This program is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation, either version 3 of the License, or
16 # the Free Software Foundation, either version 3 of the License, or
17 # (at your option) any later version.
17 # (at your option) any later version.
18 #
18 #
19 # This program is distributed in the hope that it will be useful,
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
22 # GNU General Public License for more details.
23 #
23 #
24 # You should have received a copy of the GNU General Public License
24 # You should have received a copy of the GNU General Public License
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 import sys
26 import sys
27 import platform
27 import platform
28
28
29 VERSION = (1, 4, 0, 'b')
29 VERSION = (1, 4, 0, 'b')
30
30
31 try:
31 try:
32 from rhodecode.lib import get_current_revision
32 from rhodecode.lib import get_current_revision
33 _rev = get_current_revision()
33 _rev = get_current_revision()
34 if _rev and len(VERSION) > 3:
34 if _rev and len(VERSION) > 3:
35 VERSION += ('dev%s' % _rev[0],)
35 VERSION += ('dev%s' % _rev[0],)
36 except ImportError:
36 except ImportError:
37 pass
37 pass
38
38
39 __version__ = ('.'.join((str(each) for each in VERSION[:3])) +
39 __version__ = ('.'.join((str(each) for each in VERSION[:3])) +
40 '.'.join(VERSION[3:]))
40 '.'.join(VERSION[3:]))
41 __dbversion__ = 5 # defines current db version for migrations
41 __dbversion__ = 5 # defines current db version for migrations
42 __platform__ = platform.system()
42 __platform__ = platform.system()
43 __license__ = 'GPLv3'
43 __license__ = 'GPLv3'
44 __py_version__ = sys.version_info
44 __py_version__ = sys.version_info
45
45
46 PLATFORM_WIN = ('Windows')
46 PLATFORM_WIN = ('Windows')
47 PLATFORM_OTHERS = ('Linux', 'Darwin', 'FreeBSD', 'OpenBSD', 'SunOS')
47 PLATFORM_OTHERS = ('Linux', 'Darwin', 'FreeBSD', 'OpenBSD', 'SunOS')
48
48
49 is_windows = __platform__ in PLATFORM_WIN
49 is_windows = __platform__ in PLATFORM_WIN
50 is_unix = __platform__ in PLATFORM_OTHERS
50 is_unix = __platform__ in PLATFORM_OTHERS
51
51
52 requirements = [
52 requirements = [
53 "Pylons==1.0.0",
53 "Pylons==1.0.0",
54 "Beaker==1.6.3",
54 "Beaker==1.6.3",
55 "WebHelpers==1.3",
55 "WebHelpers==1.3",
56 "formencode==1.2.4",
56 "formencode==1.2.4",
57 "SQLAlchemy==0.7.6",
57 "SQLAlchemy==0.7.6",
58 "Mako==0.7.0",
58 "Mako==0.7.0",
59 "pygments>=1.4",
59 "pygments>=1.4",
60 "whoosh>=2.4.0,<2.5",
60 "whoosh>=2.4.0,<2.5",
61 "celery>=2.2.5,<2.3",
61 "celery>=2.2.5,<2.3",
62 "babel",
62 "babel",
63 "python-dateutil>=1.5.0,<2.0.0",
63 "python-dateutil>=1.5.0,<2.0.0",
64 "dulwich>=0.8.5,<0.9.0",
64 "dulwich>=0.8.5,<0.9.0",
65 "webob==1.0.8",
65 "webob==1.0.8",
66 "markdown==2.1.1",
66 "markdown==2.1.1",
67 "docutils==0.8.1",
67 "docutils==0.8.1",
68 "simplejson==2.5.2",
68 "simplejson==2.5.2",
69 ]
69 ]
70
70
71 if __py_version__ < (2, 6):
71 if __py_version__ < (2, 6):
72 requirements.append("pysqlite")
72 requirements.append("pysqlite")
73
73
74 if is_windows:
74 if is_windows:
75 requirements.append("mercurial>=2.2.1,<2.3")
75 requirements.append("mercurial>=2.2.1,<2.3")
76 else:
76 else:
77 requirements.append("py-bcrypt")
77 requirements.append("py-bcrypt")
78 requirements.append("mercurial>=2.2.1,<2.3")
78 requirements.append("mercurial>=2.2.1,<2.3")
79
79
80
80
81 def get_version():
81 def get_version():
82 """Returns shorter version (digit parts only) as string."""
82 """Returns shorter version (digit parts only) as string."""
83
83
84 return '.'.join((str(each) for each in VERSION[:3]))
84 return '.'.join((str(each) for each in VERSION[:3]))
85
85
86 BACKENDS = {
86 BACKENDS = {
87 'hg': 'Mercurial repository',
87 'hg': 'Mercurial repository',
88 'git': 'Git repository',
88 'git': 'Git repository',
89 }
89 }
90
90
91 CELERY_ON = False
91 CELERY_ON = False
92 CELERY_EAGER = False
92
93
93 # link to config for pylons
94 # link to config for pylons
94 CONFIG = {}
95 CONFIG = {}
95
96
96 # Linked module for extensions
97 # Linked module for extensions
97 EXTENSIONS = {}
98 EXTENSIONS = {}
@@ -1,96 +1,97 b''
1 """Pylons environment configuration"""
1 """Pylons environment configuration"""
2
2
3 import os
3 import os
4 import logging
4 import logging
5 import rhodecode
5 import rhodecode
6
6
7 from mako.lookup import TemplateLookup
7 from mako.lookup import TemplateLookup
8 from pylons.configuration import PylonsConfig
8 from pylons.configuration import PylonsConfig
9 from pylons.error import handle_mako_error
9 from pylons.error import handle_mako_error
10
10
11 # don't remove this import it does magic for celery
11 # don't remove this import it does magic for celery
12 from rhodecode.lib import celerypylons
12 from rhodecode.lib import celerypylons
13
13
14 import rhodecode.lib.app_globals as app_globals
14 import rhodecode.lib.app_globals as app_globals
15
15
16 from rhodecode.config.routing import make_map
16 from rhodecode.config.routing import make_map
17
17
18 from rhodecode.lib import helpers
18 from rhodecode.lib import helpers
19 from rhodecode.lib.auth import set_available_permissions
19 from rhodecode.lib.auth import set_available_permissions
20 from rhodecode.lib.utils import repo2db_mapper, make_ui, set_rhodecode_config,\
20 from rhodecode.lib.utils import repo2db_mapper, make_ui, set_rhodecode_config,\
21 load_rcextensions
21 load_rcextensions
22 from rhodecode.lib.utils2 import engine_from_config, str2bool
22 from rhodecode.lib.utils2 import engine_from_config, str2bool
23 from rhodecode.model import init_model
23 from rhodecode.model import init_model
24 from rhodecode.model.scm import ScmModel
24 from rhodecode.model.scm import ScmModel
25
25
26 log = logging.getLogger(__name__)
26 log = logging.getLogger(__name__)
27
27
28
28
29 def load_environment(global_conf, app_conf, initial=False):
29 def load_environment(global_conf, app_conf, initial=False):
30 """
30 """
31 Configure the Pylons environment via the ``pylons.config``
31 Configure the Pylons environment via the ``pylons.config``
32 object
32 object
33 """
33 """
34 config = PylonsConfig()
34 config = PylonsConfig()
35
35
36 # Pylons paths
36 # Pylons paths
37 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
37 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
38 paths = dict(
38 paths = dict(
39 root=root,
39 root=root,
40 controllers=os.path.join(root, 'controllers'),
40 controllers=os.path.join(root, 'controllers'),
41 static_files=os.path.join(root, 'public'),
41 static_files=os.path.join(root, 'public'),
42 templates=[os.path.join(root, 'templates')]
42 templates=[os.path.join(root, 'templates')]
43 )
43 )
44
44
45 # Initialize config with the basic options
45 # Initialize config with the basic options
46 config.init_app(global_conf, app_conf, package='rhodecode', paths=paths)
46 config.init_app(global_conf, app_conf, package='rhodecode', paths=paths)
47
47
48 # store some globals into rhodecode
48 # store some globals into rhodecode
49 rhodecode.CELERY_ON = str2bool(config['app_conf'].get('use_celery'))
49 rhodecode.CELERY_ON = str2bool(config['app_conf'].get('use_celery'))
50 rhodecode.CELERY_EAGER = str2bool(config['app_conf'].get('celery.always.eager'))
50
51
51 config['routes.map'] = make_map(config)
52 config['routes.map'] = make_map(config)
52 config['pylons.app_globals'] = app_globals.Globals(config)
53 config['pylons.app_globals'] = app_globals.Globals(config)
53 config['pylons.h'] = helpers
54 config['pylons.h'] = helpers
54 rhodecode.CONFIG = config
55 rhodecode.CONFIG = config
55
56
56 load_rcextensions(root_path=config['here'])
57 load_rcextensions(root_path=config['here'])
57
58
58 # Setup cache object as early as possible
59 # Setup cache object as early as possible
59 import pylons
60 import pylons
60 pylons.cache._push_object(config['pylons.app_globals'].cache)
61 pylons.cache._push_object(config['pylons.app_globals'].cache)
61
62
62 # Create the Mako TemplateLookup, with the default auto-escaping
63 # Create the Mako TemplateLookup, with the default auto-escaping
63 config['pylons.app_globals'].mako_lookup = TemplateLookup(
64 config['pylons.app_globals'].mako_lookup = TemplateLookup(
64 directories=paths['templates'],
65 directories=paths['templates'],
65 error_handler=handle_mako_error,
66 error_handler=handle_mako_error,
66 module_directory=os.path.join(app_conf['cache_dir'], 'templates'),
67 module_directory=os.path.join(app_conf['cache_dir'], 'templates'),
67 input_encoding='utf-8', default_filters=['escape'],
68 input_encoding='utf-8', default_filters=['escape'],
68 imports=['from webhelpers.html import escape'])
69 imports=['from webhelpers.html import escape'])
69
70
70 # sets the c attribute access when don't existing attribute are accessed
71 # sets the c attribute access when don't existing attribute are accessed
71 config['pylons.strict_tmpl_context'] = True
72 config['pylons.strict_tmpl_context'] = True
72 test = os.path.split(config['__file__'])[-1] == 'test.ini'
73 test = os.path.split(config['__file__'])[-1] == 'test.ini'
73 if test:
74 if test:
74 from rhodecode.lib.utils import create_test_env, create_test_index
75 from rhodecode.lib.utils import create_test_env, create_test_index
75 from rhodecode.tests import TESTS_TMP_PATH
76 from rhodecode.tests import TESTS_TMP_PATH
76 create_test_env(TESTS_TMP_PATH, config)
77 create_test_env(TESTS_TMP_PATH, config)
77 create_test_index(TESTS_TMP_PATH, config, True)
78 create_test_index(TESTS_TMP_PATH, config, True)
78
79
79 # MULTIPLE DB configs
80 # MULTIPLE DB configs
80 # Setup the SQLAlchemy database engine
81 # Setup the SQLAlchemy database engine
81 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
82 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
82
83
83 init_model(sa_engine_db1)
84 init_model(sa_engine_db1)
84
85
85 repos_path = make_ui('db').configitems('paths')[0][1]
86 repos_path = make_ui('db').configitems('paths')[0][1]
86 repo2db_mapper(ScmModel().repo_scan(repos_path))
87 repo2db_mapper(ScmModel().repo_scan(repos_path))
87 set_available_permissions(config)
88 set_available_permissions(config)
88 config['base_path'] = repos_path
89 config['base_path'] = repos_path
89 set_rhodecode_config(config)
90 set_rhodecode_config(config)
90 # CONFIGURATION OPTIONS HERE (note: all config options will override
91 # CONFIGURATION OPTIONS HERE (note: all config options will override
91 # any Pylons config options)
92 # any Pylons config options)
92
93
93 # store config reference into our module to skip import magic of
94 # store config reference into our module to skip import magic of
94 # pylons
95 # pylons
95 rhodecode.CONFIG.update(config)
96 rhodecode.CONFIG.update(config)
96 return config
97 return config
@@ -1,128 +1,128 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 rhodecode.lib.celerylib.__init__
3 rhodecode.lib.celerylib.__init__
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
5
6 celery libs for RhodeCode
6 celery libs for RhodeCode
7
7
8 :created_on: Nov 27, 2010
8 :created_on: Nov 27, 2010
9 :author: marcink
9 :author: marcink
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details.
11 :license: GPLv3, see COPYING for more details.
12 """
12 """
13 # This program is free software: you can redistribute it and/or modify
13 # This program is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation, either version 3 of the License, or
15 # the Free Software Foundation, either version 3 of the License, or
16 # (at your option) any later version.
16 # (at your option) any later version.
17 #
17 #
18 # This program is distributed in the hope that it will be useful,
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
21 # GNU General Public License for more details.
22 #
22 #
23 # You should have received a copy of the GNU General Public License
23 # You should have received a copy of the GNU General Public License
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25
25
26 import os
26 import os
27 import sys
27 import sys
28 import socket
28 import socket
29 import traceback
29 import traceback
30 import logging
30 import logging
31 from os.path import dirname as dn, join as jn
31 from os.path import dirname as dn, join as jn
32 from pylons import config
32 from pylons import config
33
33
34 from hashlib import md5
34 from hashlib import md5
35 from decorator import decorator
35 from decorator import decorator
36
36
37 from rhodecode.lib.vcs.utils.lazy import LazyProperty
37 from rhodecode.lib.vcs.utils.lazy import LazyProperty
38 from rhodecode import CELERY_ON
38 from rhodecode import CELERY_ON, CELERY_EAGER
39 from rhodecode.lib.utils2 import str2bool, safe_str
39 from rhodecode.lib.utils2 import str2bool, safe_str
40 from rhodecode.lib.pidlock import DaemonLock, LockHeld
40 from rhodecode.lib.pidlock import DaemonLock, LockHeld
41 from rhodecode.model import init_model
41 from rhodecode.model import init_model
42 from rhodecode.model import meta
42 from rhodecode.model import meta
43 from rhodecode.model.db import Statistics, Repository, User
43 from rhodecode.model.db import Statistics, Repository, User
44
44
45 from sqlalchemy import engine_from_config
45 from sqlalchemy import engine_from_config
46
46
47 from celery.messaging import establish_connection
47 from celery.messaging import establish_connection
48
48
49 log = logging.getLogger(__name__)
49 log = logging.getLogger(__name__)
50
50
51
51
52 class ResultWrapper(object):
52 class ResultWrapper(object):
53 def __init__(self, task):
53 def __init__(self, task):
54 self.task = task
54 self.task = task
55
55
56 @LazyProperty
56 @LazyProperty
57 def result(self):
57 def result(self):
58 return self.task
58 return self.task
59
59
60
60
61 def run_task(task, *args, **kwargs):
61 def run_task(task, *args, **kwargs):
62 if CELERY_ON:
62 if CELERY_ON:
63 try:
63 try:
64 t = task.apply_async(args=args, kwargs=kwargs)
64 t = task.apply_async(args=args, kwargs=kwargs)
65 log.info('running task %s:%s' % (t.task_id, task))
65 log.info('running task %s:%s' % (t.task_id, task))
66 return t
66 return t
67
67
68 except socket.error, e:
68 except socket.error, e:
69 if isinstance(e, IOError) and e.errno == 111:
69 if isinstance(e, IOError) and e.errno == 111:
70 log.debug('Unable to connect to celeryd. Sync execution')
70 log.debug('Unable to connect to celeryd. Sync execution')
71 else:
71 else:
72 log.error(traceback.format_exc())
72 log.error(traceback.format_exc())
73 except KeyError, e:
73 except KeyError, e:
74 log.debug('Unable to connect to celeryd. Sync execution')
74 log.debug('Unable to connect to celeryd. Sync execution')
75 except Exception, e:
75 except Exception, e:
76 log.error(traceback.format_exc())
76 log.error(traceback.format_exc())
77
77
78 log.debug('executing task %s in sync mode' % task)
78 log.debug('executing task %s in sync mode' % task)
79 return ResultWrapper(task(*args, **kwargs))
79 return ResultWrapper(task(*args, **kwargs))
80
80
81
81
82 def __get_lockkey(func, *fargs, **fkwargs):
82 def __get_lockkey(func, *fargs, **fkwargs):
83 params = list(fargs)
83 params = list(fargs)
84 params.extend(['%s-%s' % ar for ar in fkwargs.items()])
84 params.extend(['%s-%s' % ar for ar in fkwargs.items()])
85
85
86 func_name = str(func.__name__) if hasattr(func, '__name__') else str(func)
86 func_name = str(func.__name__) if hasattr(func, '__name__') else str(func)
87
87
88 lockkey = 'task_%s.lock' % \
88 lockkey = 'task_%s.lock' % \
89 md5(func_name + '-' + '-'.join(map(safe_str, params))).hexdigest()
89 md5(func_name + '-' + '-'.join(map(safe_str, params))).hexdigest()
90 return lockkey
90 return lockkey
91
91
92
92
93 def locked_task(func):
93 def locked_task(func):
94 def __wrapper(func, *fargs, **fkwargs):
94 def __wrapper(func, *fargs, **fkwargs):
95 lockkey = __get_lockkey(func, *fargs, **fkwargs)
95 lockkey = __get_lockkey(func, *fargs, **fkwargs)
96 lockkey_path = config['here']
96 lockkey_path = config['here']
97
97
98 log.info('running task with lockkey %s' % lockkey)
98 log.info('running task with lockkey %s' % lockkey)
99 try:
99 try:
100 l = DaemonLock(file_=jn(lockkey_path, lockkey))
100 l = DaemonLock(file_=jn(lockkey_path, lockkey))
101 ret = func(*fargs, **fkwargs)
101 ret = func(*fargs, **fkwargs)
102 l.release()
102 l.release()
103 return ret
103 return ret
104 except LockHeld:
104 except LockHeld:
105 log.info('LockHeld')
105 log.info('LockHeld')
106 return 'Task with key %s already running' % lockkey
106 return 'Task with key %s already running' % lockkey
107
107
108 return decorator(__wrapper, func)
108 return decorator(__wrapper, func)
109
109
110
110
111 def get_session():
111 def get_session():
112 if CELERY_ON:
112 if CELERY_ON:
113 engine = engine_from_config(config, 'sqlalchemy.db1.')
113 engine = engine_from_config(config, 'sqlalchemy.db1.')
114 init_model(engine)
114 init_model(engine)
115 sa = meta.Session
115 sa = meta.Session
116 return sa
116 return sa
117
117
118
118
119 def dbsession(func):
119 def dbsession(func):
120 def __wrapper(func, *fargs, **fkwargs):
120 def __wrapper(func, *fargs, **fkwargs):
121 try:
121 try:
122 ret = func(*fargs, **fkwargs)
122 ret = func(*fargs, **fkwargs)
123 return ret
123 return ret
124 finally:
124 finally:
125 if CELERY_ON:
125 if CELERY_ON and CELERY_EAGER is False:
126 meta.Session.remove()
126 meta.Session.remove()
127
127
128 return decorator(__wrapper, func)
128 return decorator(__wrapper, func)
@@ -1,421 +1,421 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 rhodecode.lib.celerylib.tasks
3 rhodecode.lib.celerylib.tasks
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
5
6 RhodeCode task modules, containing all task that suppose to be run
6 RhodeCode task modules, containing all task that suppose to be run
7 by celery daemon
7 by celery daemon
8
8
9 :created_on: Oct 6, 2010
9 :created_on: Oct 6, 2010
10 :author: marcink
10 :author: marcink
11 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
11 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
12 :license: GPLv3, see COPYING for more details.
12 :license: GPLv3, see COPYING for more details.
13 """
13 """
14 # This program is free software: you can redistribute it and/or modify
14 # This program is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation, either version 3 of the License, or
16 # the Free Software Foundation, either version 3 of the License, or
17 # (at your option) any later version.
17 # (at your option) any later version.
18 #
18 #
19 # This program is distributed in the hope that it will be useful,
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
22 # GNU General Public License for more details.
23 #
23 #
24 # You should have received a copy of the GNU General Public License
24 # You should have received a copy of the GNU General Public License
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 from celery.decorators import task
26 from celery.decorators import task
27
27
28 import os
28 import os
29 import traceback
29 import traceback
30 import logging
30 import logging
31 from os.path import join as jn
31 from os.path import join as jn
32
32
33 from time import mktime
33 from time import mktime
34 from operator import itemgetter
34 from operator import itemgetter
35 from string import lower
35 from string import lower
36
36
37 from pylons import config, url
37 from pylons import config, url
38 from pylons.i18n.translation import _
38 from pylons.i18n.translation import _
39
39
40 from rhodecode.lib.vcs import get_backend
40 from rhodecode.lib.vcs import get_backend
41
41
42 from rhodecode import CELERY_ON
42 from rhodecode import CELERY_ON, CELERY_EAGER
43 from rhodecode.lib.utils2 import safe_str
43 from rhodecode.lib.utils2 import safe_str
44 from rhodecode.lib.celerylib import run_task, locked_task, dbsession, \
44 from rhodecode.lib.celerylib import run_task, locked_task, dbsession, \
45 str2bool, __get_lockkey, LockHeld, DaemonLock, get_session
45 str2bool, __get_lockkey, LockHeld, DaemonLock, get_session
46 from rhodecode.lib.helpers import person
46 from rhodecode.lib.helpers import person
47 from rhodecode.lib.rcmail.smtp_mailer import SmtpMailer
47 from rhodecode.lib.rcmail.smtp_mailer import SmtpMailer
48 from rhodecode.lib.utils import add_cache, action_logger
48 from rhodecode.lib.utils import add_cache, action_logger
49 from rhodecode.lib.compat import json, OrderedDict
49 from rhodecode.lib.compat import json, OrderedDict
50 from rhodecode.lib.hooks import log_create_repository
50 from rhodecode.lib.hooks import log_create_repository
51
51
52 from rhodecode.model.db import Statistics, Repository, User
52 from rhodecode.model.db import Statistics, Repository, User
53
53
54
54
55 add_cache(config)
55 add_cache(config)
56
56
57 __all__ = ['whoosh_index', 'get_commits_stats',
57 __all__ = ['whoosh_index', 'get_commits_stats',
58 'reset_user_password', 'send_email']
58 'reset_user_password', 'send_email']
59
59
60
60
61 def get_logger(cls):
61 def get_logger(cls):
62 if CELERY_ON:
62 if CELERY_ON:
63 try:
63 try:
64 log = cls.get_logger()
64 log = cls.get_logger()
65 except:
65 except:
66 log = logging.getLogger(__name__)
66 log = logging.getLogger(__name__)
67 else:
67 else:
68 log = logging.getLogger(__name__)
68 log = logging.getLogger(__name__)
69
69
70 return log
70 return log
71
71
72
72
73 @task(ignore_result=True)
73 @task(ignore_result=True)
74 @locked_task
74 @locked_task
75 @dbsession
75 @dbsession
76 def whoosh_index(repo_location, full_index):
76 def whoosh_index(repo_location, full_index):
77 from rhodecode.lib.indexers.daemon import WhooshIndexingDaemon
77 from rhodecode.lib.indexers.daemon import WhooshIndexingDaemon
78 log = whoosh_index.get_logger(whoosh_index)
78 log = whoosh_index.get_logger(whoosh_index)
79 DBS = get_session()
79 DBS = get_session()
80
80
81 index_location = config['index_dir']
81 index_location = config['index_dir']
82 WhooshIndexingDaemon(index_location=index_location,
82 WhooshIndexingDaemon(index_location=index_location,
83 repo_location=repo_location, sa=DBS)\
83 repo_location=repo_location, sa=DBS)\
84 .run(full_index=full_index)
84 .run(full_index=full_index)
85
85
86
86
87 @task(ignore_result=True)
87 @task(ignore_result=True)
88 @dbsession
88 @dbsession
89 def get_commits_stats(repo_name, ts_min_y, ts_max_y):
89 def get_commits_stats(repo_name, ts_min_y, ts_max_y):
90 log = get_logger(get_commits_stats)
90 log = get_logger(get_commits_stats)
91 DBS = get_session()
91 DBS = get_session()
92 lockkey = __get_lockkey('get_commits_stats', repo_name, ts_min_y,
92 lockkey = __get_lockkey('get_commits_stats', repo_name, ts_min_y,
93 ts_max_y)
93 ts_max_y)
94 lockkey_path = config['here']
94 lockkey_path = config['here']
95
95
96 log.info('running task with lockkey %s' % lockkey)
96 log.info('running task with lockkey %s' % lockkey)
97
97
98 try:
98 try:
99 lock = l = DaemonLock(file_=jn(lockkey_path, lockkey))
99 lock = l = DaemonLock(file_=jn(lockkey_path, lockkey))
100
100
101 # for js data compatibility cleans the key for person from '
101 # for js data compatibility cleans the key for person from '
102 akc = lambda k: person(k).replace('"', "")
102 akc = lambda k: person(k).replace('"', "")
103
103
104 co_day_auth_aggr = {}
104 co_day_auth_aggr = {}
105 commits_by_day_aggregate = {}
105 commits_by_day_aggregate = {}
106 repo = Repository.get_by_repo_name(repo_name)
106 repo = Repository.get_by_repo_name(repo_name)
107 if repo is None:
107 if repo is None:
108 return True
108 return True
109
109
110 repo = repo.scm_instance
110 repo = repo.scm_instance
111 repo_size = repo.count()
111 repo_size = repo.count()
112 # return if repo have no revisions
112 # return if repo have no revisions
113 if repo_size < 1:
113 if repo_size < 1:
114 lock.release()
114 lock.release()
115 return True
115 return True
116
116
117 skip_date_limit = True
117 skip_date_limit = True
118 parse_limit = int(config['app_conf'].get('commit_parse_limit'))
118 parse_limit = int(config['app_conf'].get('commit_parse_limit'))
119 last_rev = None
119 last_rev = None
120 last_cs = None
120 last_cs = None
121 timegetter = itemgetter('time')
121 timegetter = itemgetter('time')
122
122
123 dbrepo = DBS.query(Repository)\
123 dbrepo = DBS.query(Repository)\
124 .filter(Repository.repo_name == repo_name).scalar()
124 .filter(Repository.repo_name == repo_name).scalar()
125 cur_stats = DBS.query(Statistics)\
125 cur_stats = DBS.query(Statistics)\
126 .filter(Statistics.repository == dbrepo).scalar()
126 .filter(Statistics.repository == dbrepo).scalar()
127
127
128 if cur_stats is not None:
128 if cur_stats is not None:
129 last_rev = cur_stats.stat_on_revision
129 last_rev = cur_stats.stat_on_revision
130
130
131 if last_rev == repo.get_changeset().revision and repo_size > 1:
131 if last_rev == repo.get_changeset().revision and repo_size > 1:
132 # pass silently without any work if we're not on first revision or
132 # pass silently without any work if we're not on first revision or
133 # current state of parsing revision(from db marker) is the
133 # current state of parsing revision(from db marker) is the
134 # last revision
134 # last revision
135 lock.release()
135 lock.release()
136 return True
136 return True
137
137
138 if cur_stats:
138 if cur_stats:
139 commits_by_day_aggregate = OrderedDict(json.loads(
139 commits_by_day_aggregate = OrderedDict(json.loads(
140 cur_stats.commit_activity_combined))
140 cur_stats.commit_activity_combined))
141 co_day_auth_aggr = json.loads(cur_stats.commit_activity)
141 co_day_auth_aggr = json.loads(cur_stats.commit_activity)
142
142
143 log.debug('starting parsing %s' % parse_limit)
143 log.debug('starting parsing %s' % parse_limit)
144 lmktime = mktime
144 lmktime = mktime
145
145
146 last_rev = last_rev + 1 if last_rev >= 0 else 0
146 last_rev = last_rev + 1 if last_rev >= 0 else 0
147 log.debug('Getting revisions from %s to %s' % (
147 log.debug('Getting revisions from %s to %s' % (
148 last_rev, last_rev + parse_limit)
148 last_rev, last_rev + parse_limit)
149 )
149 )
150 for cs in repo[last_rev:last_rev + parse_limit]:
150 for cs in repo[last_rev:last_rev + parse_limit]:
151 log.debug('parsing %s' % cs)
151 log.debug('parsing %s' % cs)
152 last_cs = cs # remember last parsed changeset
152 last_cs = cs # remember last parsed changeset
153 k = lmktime([cs.date.timetuple()[0], cs.date.timetuple()[1],
153 k = lmktime([cs.date.timetuple()[0], cs.date.timetuple()[1],
154 cs.date.timetuple()[2], 0, 0, 0, 0, 0, 0])
154 cs.date.timetuple()[2], 0, 0, 0, 0, 0, 0])
155
155
156 if akc(cs.author) in co_day_auth_aggr:
156 if akc(cs.author) in co_day_auth_aggr:
157 try:
157 try:
158 l = [timegetter(x) for x in
158 l = [timegetter(x) for x in
159 co_day_auth_aggr[akc(cs.author)]['data']]
159 co_day_auth_aggr[akc(cs.author)]['data']]
160 time_pos = l.index(k)
160 time_pos = l.index(k)
161 except ValueError:
161 except ValueError:
162 time_pos = False
162 time_pos = False
163
163
164 if time_pos >= 0 and time_pos is not False:
164 if time_pos >= 0 and time_pos is not False:
165
165
166 datadict = \
166 datadict = \
167 co_day_auth_aggr[akc(cs.author)]['data'][time_pos]
167 co_day_auth_aggr[akc(cs.author)]['data'][time_pos]
168
168
169 datadict["commits"] += 1
169 datadict["commits"] += 1
170 datadict["added"] += len(cs.added)
170 datadict["added"] += len(cs.added)
171 datadict["changed"] += len(cs.changed)
171 datadict["changed"] += len(cs.changed)
172 datadict["removed"] += len(cs.removed)
172 datadict["removed"] += len(cs.removed)
173
173
174 else:
174 else:
175 if k >= ts_min_y and k <= ts_max_y or skip_date_limit:
175 if k >= ts_min_y and k <= ts_max_y or skip_date_limit:
176
176
177 datadict = {"time": k,
177 datadict = {"time": k,
178 "commits": 1,
178 "commits": 1,
179 "added": len(cs.added),
179 "added": len(cs.added),
180 "changed": len(cs.changed),
180 "changed": len(cs.changed),
181 "removed": len(cs.removed),
181 "removed": len(cs.removed),
182 }
182 }
183 co_day_auth_aggr[akc(cs.author)]['data']\
183 co_day_auth_aggr[akc(cs.author)]['data']\
184 .append(datadict)
184 .append(datadict)
185
185
186 else:
186 else:
187 if k >= ts_min_y and k <= ts_max_y or skip_date_limit:
187 if k >= ts_min_y and k <= ts_max_y or skip_date_limit:
188 co_day_auth_aggr[akc(cs.author)] = {
188 co_day_auth_aggr[akc(cs.author)] = {
189 "label": akc(cs.author),
189 "label": akc(cs.author),
190 "data": [{"time":k,
190 "data": [{"time":k,
191 "commits":1,
191 "commits":1,
192 "added":len(cs.added),
192 "added":len(cs.added),
193 "changed":len(cs.changed),
193 "changed":len(cs.changed),
194 "removed":len(cs.removed),
194 "removed":len(cs.removed),
195 }],
195 }],
196 "schema": ["commits"],
196 "schema": ["commits"],
197 }
197 }
198
198
199 #gather all data by day
199 #gather all data by day
200 if k in commits_by_day_aggregate:
200 if k in commits_by_day_aggregate:
201 commits_by_day_aggregate[k] += 1
201 commits_by_day_aggregate[k] += 1
202 else:
202 else:
203 commits_by_day_aggregate[k] = 1
203 commits_by_day_aggregate[k] = 1
204
204
205 overview_data = sorted(commits_by_day_aggregate.items(),
205 overview_data = sorted(commits_by_day_aggregate.items(),
206 key=itemgetter(0))
206 key=itemgetter(0))
207
207
208 if not co_day_auth_aggr:
208 if not co_day_auth_aggr:
209 co_day_auth_aggr[akc(repo.contact)] = {
209 co_day_auth_aggr[akc(repo.contact)] = {
210 "label": akc(repo.contact),
210 "label": akc(repo.contact),
211 "data": [0, 1],
211 "data": [0, 1],
212 "schema": ["commits"],
212 "schema": ["commits"],
213 }
213 }
214
214
215 stats = cur_stats if cur_stats else Statistics()
215 stats = cur_stats if cur_stats else Statistics()
216 stats.commit_activity = json.dumps(co_day_auth_aggr)
216 stats.commit_activity = json.dumps(co_day_auth_aggr)
217 stats.commit_activity_combined = json.dumps(overview_data)
217 stats.commit_activity_combined = json.dumps(overview_data)
218
218
219 log.debug('last revison %s' % last_rev)
219 log.debug('last revison %s' % last_rev)
220 leftovers = len(repo.revisions[last_rev:])
220 leftovers = len(repo.revisions[last_rev:])
221 log.debug('revisions to parse %s' % leftovers)
221 log.debug('revisions to parse %s' % leftovers)
222
222
223 if last_rev == 0 or leftovers < parse_limit:
223 if last_rev == 0 or leftovers < parse_limit:
224 log.debug('getting code trending stats')
224 log.debug('getting code trending stats')
225 stats.languages = json.dumps(__get_codes_stats(repo_name))
225 stats.languages = json.dumps(__get_codes_stats(repo_name))
226
226
227 try:
227 try:
228 stats.repository = dbrepo
228 stats.repository = dbrepo
229 stats.stat_on_revision = last_cs.revision if last_cs else 0
229 stats.stat_on_revision = last_cs.revision if last_cs else 0
230 DBS.add(stats)
230 DBS.add(stats)
231 DBS.commit()
231 DBS.commit()
232 except:
232 except:
233 log.error(traceback.format_exc())
233 log.error(traceback.format_exc())
234 DBS.rollback()
234 DBS.rollback()
235 lock.release()
235 lock.release()
236 return False
236 return False
237
237
238 # final release
238 # final release
239 lock.release()
239 lock.release()
240
240
241 # execute another task if celery is enabled
241 # execute another task if celery is enabled
242 if len(repo.revisions) > 1 and CELERY_ON:
242 if len(repo.revisions) > 1 and CELERY_ON:
243 run_task(get_commits_stats, repo_name, ts_min_y, ts_max_y)
243 run_task(get_commits_stats, repo_name, ts_min_y, ts_max_y)
244 return True
244 return True
245 except LockHeld:
245 except LockHeld:
246 log.info('LockHeld')
246 log.info('LockHeld')
247 return 'Task with key %s already running' % lockkey
247 return 'Task with key %s already running' % lockkey
248
248
249 @task(ignore_result=True)
249 @task(ignore_result=True)
250 @dbsession
250 @dbsession
251 def send_password_link(user_email):
251 def send_password_link(user_email):
252 from rhodecode.model.notification import EmailNotificationModel
252 from rhodecode.model.notification import EmailNotificationModel
253
253
254 log = get_logger(send_password_link)
254 log = get_logger(send_password_link)
255 DBS = get_session()
255 DBS = get_session()
256
256
257 try:
257 try:
258 user = User.get_by_email(user_email)
258 user = User.get_by_email(user_email)
259 if user:
259 if user:
260 log.debug('password reset user found %s' % user)
260 log.debug('password reset user found %s' % user)
261 link = url('reset_password_confirmation', key=user.api_key,
261 link = url('reset_password_confirmation', key=user.api_key,
262 qualified=True)
262 qualified=True)
263 reg_type = EmailNotificationModel.TYPE_PASSWORD_RESET
263 reg_type = EmailNotificationModel.TYPE_PASSWORD_RESET
264 body = EmailNotificationModel().get_email_tmpl(reg_type,
264 body = EmailNotificationModel().get_email_tmpl(reg_type,
265 **{'user':user.short_contact,
265 **{'user':user.short_contact,
266 'reset_url':link})
266 'reset_url':link})
267 log.debug('sending email')
267 log.debug('sending email')
268 run_task(send_email, user_email,
268 run_task(send_email, user_email,
269 _("password reset link"), body)
269 _("password reset link"), body)
270 log.info('send new password mail to %s' % user_email)
270 log.info('send new password mail to %s' % user_email)
271 else:
271 else:
272 log.debug("password reset email %s not found" % user_email)
272 log.debug("password reset email %s not found" % user_email)
273 except:
273 except:
274 log.error(traceback.format_exc())
274 log.error(traceback.format_exc())
275 return False
275 return False
276
276
277 return True
277 return True
278
278
279 @task(ignore_result=True)
279 @task(ignore_result=True)
280 @dbsession
280 @dbsession
281 def reset_user_password(user_email):
281 def reset_user_password(user_email):
282 from rhodecode.lib import auth
282 from rhodecode.lib import auth
283
283
284 log = get_logger(reset_user_password)
284 log = get_logger(reset_user_password)
285 DBS = get_session()
285 DBS = get_session()
286
286
287 try:
287 try:
288 try:
288 try:
289 user = User.get_by_email(user_email)
289 user = User.get_by_email(user_email)
290 new_passwd = auth.PasswordGenerator().gen_password(8,
290 new_passwd = auth.PasswordGenerator().gen_password(8,
291 auth.PasswordGenerator.ALPHABETS_BIG_SMALL)
291 auth.PasswordGenerator.ALPHABETS_BIG_SMALL)
292 if user:
292 if user:
293 user.password = auth.get_crypt_password(new_passwd)
293 user.password = auth.get_crypt_password(new_passwd)
294 user.api_key = auth.generate_api_key(user.username)
294 user.api_key = auth.generate_api_key(user.username)
295 DBS.add(user)
295 DBS.add(user)
296 DBS.commit()
296 DBS.commit()
297 log.info('change password for %s' % user_email)
297 log.info('change password for %s' % user_email)
298 if new_passwd is None:
298 if new_passwd is None:
299 raise Exception('unable to generate new password')
299 raise Exception('unable to generate new password')
300 except:
300 except:
301 log.error(traceback.format_exc())
301 log.error(traceback.format_exc())
302 DBS.rollback()
302 DBS.rollback()
303
303
304 run_task(send_email, user_email,
304 run_task(send_email, user_email,
305 'Your new password',
305 'Your new password',
306 'Your new RhodeCode password:%s' % (new_passwd))
306 'Your new RhodeCode password:%s' % (new_passwd))
307 log.info('send new password mail to %s' % user_email)
307 log.info('send new password mail to %s' % user_email)
308
308
309 except:
309 except:
310 log.error('Failed to update user password')
310 log.error('Failed to update user password')
311 log.error(traceback.format_exc())
311 log.error(traceback.format_exc())
312
312
313 return True
313 return True
314
314
315
315
316 @task(ignore_result=True)
316 @task(ignore_result=True)
317 @dbsession
317 @dbsession
318 def send_email(recipients, subject, body, html_body=''):
318 def send_email(recipients, subject, body, html_body=''):
319 """
319 """
320 Sends an email with defined parameters from the .ini files.
320 Sends an email with defined parameters from the .ini files.
321
321
322 :param recipients: list of recipients, it this is empty the defined email
322 :param recipients: list of recipients, it this is empty the defined email
323 address from field 'email_to' is used instead
323 address from field 'email_to' is used instead
324 :param subject: subject of the mail
324 :param subject: subject of the mail
325 :param body: body of the mail
325 :param body: body of the mail
326 :param html_body: html version of body
326 :param html_body: html version of body
327 """
327 """
328 log = get_logger(send_email)
328 log = get_logger(send_email)
329 DBS = get_session()
329 DBS = get_session()
330
330
331 email_config = config
331 email_config = config
332 subject = "%s %s" % (email_config.get('email_prefix', ''), subject)
332 subject = "%s %s" % (email_config.get('email_prefix', ''), subject)
333 if not recipients:
333 if not recipients:
334 # if recipients are not defined we send to email_config + all admins
334 # if recipients are not defined we send to email_config + all admins
335 admins = [u.email for u in User.query()
335 admins = [u.email for u in User.query()
336 .filter(User.admin == True).all()]
336 .filter(User.admin == True).all()]
337 recipients = [email_config.get('email_to')] + admins
337 recipients = [email_config.get('email_to')] + admins
338
338
339 mail_from = email_config.get('app_email_from', 'RhodeCode')
339 mail_from = email_config.get('app_email_from', 'RhodeCode')
340 user = email_config.get('smtp_username')
340 user = email_config.get('smtp_username')
341 passwd = email_config.get('smtp_password')
341 passwd = email_config.get('smtp_password')
342 mail_server = email_config.get('smtp_server')
342 mail_server = email_config.get('smtp_server')
343 mail_port = email_config.get('smtp_port')
343 mail_port = email_config.get('smtp_port')
344 tls = str2bool(email_config.get('smtp_use_tls'))
344 tls = str2bool(email_config.get('smtp_use_tls'))
345 ssl = str2bool(email_config.get('smtp_use_ssl'))
345 ssl = str2bool(email_config.get('smtp_use_ssl'))
346 debug = str2bool(config.get('debug'))
346 debug = str2bool(config.get('debug'))
347 smtp_auth = email_config.get('smtp_auth')
347 smtp_auth = email_config.get('smtp_auth')
348
348
349 try:
349 try:
350 m = SmtpMailer(mail_from, user, passwd, mail_server, smtp_auth,
350 m = SmtpMailer(mail_from, user, passwd, mail_server, smtp_auth,
351 mail_port, ssl, tls, debug=debug)
351 mail_port, ssl, tls, debug=debug)
352 m.send(recipients, subject, body, html_body)
352 m.send(recipients, subject, body, html_body)
353 except:
353 except:
354 log.error('Mail sending failed')
354 log.error('Mail sending failed')
355 log.error(traceback.format_exc())
355 log.error(traceback.format_exc())
356 return False
356 return False
357 return True
357 return True
358
358
359
359
360 @task(ignore_result=True)
360 @task(ignore_result=True)
361 @dbsession
361 @dbsession
362 def create_repo_fork(form_data, cur_user):
362 def create_repo_fork(form_data, cur_user):
363 """
363 """
364 Creates a fork of repository using interval VCS methods
364 Creates a fork of repository using interval VCS methods
365
365
366 :param form_data:
366 :param form_data:
367 :param cur_user:
367 :param cur_user:
368 """
368 """
369 from rhodecode.model.repo import RepoModel
369 from rhodecode.model.repo import RepoModel
370
370
371 log = get_logger(create_repo_fork)
371 log = get_logger(create_repo_fork)
372 DBS = get_session()
372 DBS = get_session()
373
373
374 base_path = Repository.base_path()
374 base_path = Repository.base_path()
375
375
376 fork_repo = RepoModel(DBS).create(form_data, cur_user,
376 fork_repo = RepoModel(DBS).create(form_data, cur_user,
377 just_db=True, fork=True)
377 just_db=True, fork=True)
378
378
379 alias = form_data['repo_type']
379 alias = form_data['repo_type']
380 org_repo_name = form_data['org_path']
380 org_repo_name = form_data['org_path']
381 fork_name = form_data['repo_name_full']
381 fork_name = form_data['repo_name_full']
382 update_after_clone = form_data['update_after_clone']
382 update_after_clone = form_data['update_after_clone']
383 source_repo_path = os.path.join(base_path, org_repo_name)
383 source_repo_path = os.path.join(base_path, org_repo_name)
384 destination_fork_path = os.path.join(base_path, fork_name)
384 destination_fork_path = os.path.join(base_path, fork_name)
385
385
386 log.info('creating fork of %s as %s', source_repo_path,
386 log.info('creating fork of %s as %s', source_repo_path,
387 destination_fork_path)
387 destination_fork_path)
388 backend = get_backend(alias)
388 backend = get_backend(alias)
389 backend(safe_str(destination_fork_path), create=True,
389 backend(safe_str(destination_fork_path), create=True,
390 src_url=safe_str(source_repo_path),
390 src_url=safe_str(source_repo_path),
391 update_after_clone=update_after_clone)
391 update_after_clone=update_after_clone)
392 log_create_repository(fork_repo.get_dict(), created_by=cur_user.username)
392 log_create_repository(fork_repo.get_dict(), created_by=cur_user.username)
393
393
394 action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
394 action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
395 org_repo_name, '', DBS)
395 org_repo_name, '', DBS)
396
396
397 action_logger(cur_user, 'user_created_fork:%s' % fork_name,
397 action_logger(cur_user, 'user_created_fork:%s' % fork_name,
398 fork_name, '', DBS)
398 fork_name, '', DBS)
399 # finally commit at latest possible stage
399 # finally commit at latest possible stage
400 DBS.commit()
400 DBS.commit()
401
401
402
402
403 def __get_codes_stats(repo_name):
403 def __get_codes_stats(repo_name):
404 from rhodecode.config.conf import LANGUAGES_EXTENSIONS_MAP
404 from rhodecode.config.conf import LANGUAGES_EXTENSIONS_MAP
405 repo = Repository.get_by_repo_name(repo_name).scm_instance
405 repo = Repository.get_by_repo_name(repo_name).scm_instance
406
406
407 tip = repo.get_changeset()
407 tip = repo.get_changeset()
408 code_stats = {}
408 code_stats = {}
409
409
410 def aggregate(cs):
410 def aggregate(cs):
411 for f in cs[2]:
411 for f in cs[2]:
412 ext = lower(f.extension)
412 ext = lower(f.extension)
413 if ext in LANGUAGES_EXTENSIONS_MAP.keys() and not f.is_binary:
413 if ext in LANGUAGES_EXTENSIONS_MAP.keys() and not f.is_binary:
414 if ext in code_stats:
414 if ext in code_stats:
415 code_stats[ext] += 1
415 code_stats[ext] += 1
416 else:
416 else:
417 code_stats[ext] = 1
417 code_stats[ext] = 1
418
418
419 map(aggregate, tip.walk('/'))
419 map(aggregate, tip.walk('/'))
420
420
421 return code_stats or {}
421 return code_stats or {}
General Comments 0
You need to be logged in to leave comments. Login now