##// END OF EJS Templates
fixed missing permissions check on forks page
marcink -
r2176:162bf5c9 beta
parent child Browse files
Show More
@@ -1,615 +1,616 b''
1 .. _changelog:
1 .. _changelog:
2
2
3 =========
3 =========
4 Changelog
4 Changelog
5 =========
5 =========
6
6
7 1.3.5 (**2012-XX-XX**)
7 1.3.5 (**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 - use ext_json for json module
16 - use ext_json for json module
17
17
18 fixes
18 fixes
19 +++++
19 +++++
20
20
21 - fixed dev-version marker for stable when served from source codes
21 - fixed dev-version marker for stable when served from source codes
22 - fixed missing permission checks on show forks page
22
23
23 1.3.4 (**2012-03-28**)
24 1.3.4 (**2012-03-28**)
24 ----------------------
25 ----------------------
25
26
26 news
27 news
27 ++++
28 ++++
28
29
29 - Whoosh logging is now controlled by the .ini files logging setup
30 - Whoosh logging is now controlled by the .ini files logging setup
30 - added clone-url into edit form on /settings page
31 - added clone-url into edit form on /settings page
31 - added help text into repo add/edit forms
32 - added help text into repo add/edit forms
32 - created rcextensions module with additional mappings (ref #322) and
33 - created rcextensions module with additional mappings (ref #322) and
33 post push/pull/create repo hooks callbacks
34 post push/pull/create repo hooks callbacks
34 - implemented #377 Users view for his own permissions on account page
35 - implemented #377 Users view for his own permissions on account page
35 - #399 added inheritance of permissions for users group on repos groups
36 - #399 added inheritance of permissions for users group on repos groups
36 - #401 repository group is automatically pre-selected when adding repos
37 - #401 repository group is automatically pre-selected when adding repos
37 inside a repository group
38 inside a repository group
38 - added alternative HTTP 403 response when client failed to authenticate. Helps
39 - added alternative HTTP 403 response when client failed to authenticate. Helps
39 solving issues with Mercurial and LDAP
40 solving issues with Mercurial and LDAP
40 - #402 removed group prefix from repository name when listing repositories
41 - #402 removed group prefix from repository name when listing repositories
41 inside a group
42 inside a group
42 - added gravatars into permission view and permissions autocomplete
43 - added gravatars into permission view and permissions autocomplete
43 - #347 when running multiple RhodeCode instances, properly invalidates cache
44 - #347 when running multiple RhodeCode instances, properly invalidates cache
44 for all registered servers
45 for all registered servers
45
46
46 fixes
47 fixes
47 +++++
48 +++++
48
49
49 - fixed #390 cache invalidation problems on repos inside group
50 - fixed #390 cache invalidation problems on repos inside group
50 - fixed #385 clone by ID url was loosing proxy prefix in URL
51 - fixed #385 clone by ID url was loosing proxy prefix in URL
51 - fixed some unicode problems with waitress
52 - fixed some unicode problems with waitress
52 - fixed issue with escaping < and > in changeset commits
53 - fixed issue with escaping < and > in changeset commits
53 - fixed error occurring during recursive group creation in API
54 - fixed error occurring during recursive group creation in API
54 create_repo function
55 create_repo function
55 - fixed #393 py2.5 fixes for routes url generator
56 - fixed #393 py2.5 fixes for routes url generator
56 - fixed #397 Private repository groups shows up before login
57 - fixed #397 Private repository groups shows up before login
57 - fixed #396 fixed problems with revoking users in nested groups
58 - fixed #396 fixed problems with revoking users in nested groups
58 - fixed mysql unicode issues + specified InnoDB as default engine with
59 - fixed mysql unicode issues + specified InnoDB as default engine with
59 utf8 charset
60 utf8 charset
60 - #406 trim long branch/tag names in changelog to not break UI
61 - #406 trim long branch/tag names in changelog to not break UI
61
62
62 1.3.3 (**2012-03-02**)
63 1.3.3 (**2012-03-02**)
63 ----------------------
64 ----------------------
64
65
65 news
66 news
66 ++++
67 ++++
67
68
68
69
69 fixes
70 fixes
70 +++++
71 +++++
71
72
72 - fixed some python2.5 compatibility issues
73 - fixed some python2.5 compatibility issues
73 - fixed issues with removed repos was accidentally added as groups, after
74 - fixed issues with removed repos was accidentally added as groups, after
74 full rescan of paths
75 full rescan of paths
75 - fixes #376 Cannot edit user (using container auth)
76 - fixes #376 Cannot edit user (using container auth)
76 - fixes #378 Invalid image urls on changeset screen with proxy-prefix
77 - fixes #378 Invalid image urls on changeset screen with proxy-prefix
77 configuration
78 configuration
78 - fixed initial sorting of repos inside repo group
79 - fixed initial sorting of repos inside repo group
79 - fixes issue when user tried to resubmit same permission into user/user_groups
80 - fixes issue when user tried to resubmit same permission into user/user_groups
80 - bumped beaker version that fixes #375 leap error bug
81 - bumped beaker version that fixes #375 leap error bug
81 - fixed raw_changeset for git. It was generated with hg patch headers
82 - fixed raw_changeset for git. It was generated with hg patch headers
82 - fixed vcs issue with last_changeset for filenodes
83 - fixed vcs issue with last_changeset for filenodes
83 - fixed missing commit after hook delete
84 - fixed missing commit after hook delete
84 - fixed #372 issues with git operation detection that caused a security issue
85 - fixed #372 issues with git operation detection that caused a security issue
85 for git repos
86 for git repos
86
87
87 1.3.2 (**2012-02-28**)
88 1.3.2 (**2012-02-28**)
88 ----------------------
89 ----------------------
89
90
90 news
91 news
91 ++++
92 ++++
92
93
93
94
94 fixes
95 fixes
95 +++++
96 +++++
96
97
97 - fixed git protocol issues with repos-groups
98 - fixed git protocol issues with repos-groups
98 - fixed git remote repos validator that prevented from cloning remote git repos
99 - fixed git remote repos validator that prevented from cloning remote git repos
99 - fixes #370 ending slashes fixes for repo and groups
100 - fixes #370 ending slashes fixes for repo and groups
100 - fixes #368 improved git-protocol detection to handle other clients
101 - fixes #368 improved git-protocol detection to handle other clients
101 - fixes #366 When Setting Repository Group To Blank Repo Group Wont Be
102 - fixes #366 When Setting Repository Group To Blank Repo Group Wont Be
102 Moved To Root
103 Moved To Root
103 - fixes #371 fixed issues with beaker/sqlalchemy and non-ascii cache keys
104 - fixes #371 fixed issues with beaker/sqlalchemy and non-ascii cache keys
104 - fixed #373 missing cascade drop on user_group_to_perm table
105 - fixed #373 missing cascade drop on user_group_to_perm table
105
106
106 1.3.1 (**2012-02-27**)
107 1.3.1 (**2012-02-27**)
107 ----------------------
108 ----------------------
108
109
109 news
110 news
110 ++++
111 ++++
111
112
112
113
113 fixes
114 fixes
114 +++++
115 +++++
115
116
116 - redirection loop occurs when remember-me wasn't checked during login
117 - redirection loop occurs when remember-me wasn't checked during login
117 - fixes issues with git blob history generation
118 - fixes issues with git blob history generation
118 - don't fetch branch for git in file history dropdown. Causes unneeded slowness
119 - don't fetch branch for git in file history dropdown. Causes unneeded slowness
119
120
120 1.3.0 (**2012-02-26**)
121 1.3.0 (**2012-02-26**)
121 ----------------------
122 ----------------------
122
123
123 news
124 news
124 ++++
125 ++++
125
126
126 - code review, inspired by github code-comments
127 - code review, inspired by github code-comments
127 - #215 rst and markdown README files support
128 - #215 rst and markdown README files support
128 - #252 Container-based and proxy pass-through authentication support
129 - #252 Container-based and proxy pass-through authentication support
129 - #44 branch browser. Filtering of changelog by branches
130 - #44 branch browser. Filtering of changelog by branches
130 - mercurial bookmarks support
131 - mercurial bookmarks support
131 - new hover top menu, optimized to add maximum size for important views
132 - new hover top menu, optimized to add maximum size for important views
132 - configurable clone url template with possibility to specify protocol like
133 - configurable clone url template with possibility to specify protocol like
133 ssh:// or http:// and also manually alter other parts of clone_url.
134 ssh:// or http:// and also manually alter other parts of clone_url.
134 - enabled largefiles extension by default
135 - enabled largefiles extension by default
135 - optimized summary file pages and saved a lot of unused space in them
136 - optimized summary file pages and saved a lot of unused space in them
136 - #239 option to manually mark repository as fork
137 - #239 option to manually mark repository as fork
137 - #320 mapping of commit authors to RhodeCode users
138 - #320 mapping of commit authors to RhodeCode users
138 - #304 hashes are displayed using monospace font
139 - #304 hashes are displayed using monospace font
139 - diff configuration, toggle white lines and context lines
140 - diff configuration, toggle white lines and context lines
140 - #307 configurable diffs, whitespace toggle, increasing context lines
141 - #307 configurable diffs, whitespace toggle, increasing context lines
141 - sorting on branches, tags and bookmarks using YUI datatable
142 - sorting on branches, tags and bookmarks using YUI datatable
142 - improved file filter on files page
143 - improved file filter on files page
143 - implements #330 api method for listing nodes ar particular revision
144 - implements #330 api method for listing nodes ar particular revision
144 - #73 added linking issues in commit messages to chosen issue tracker url
145 - #73 added linking issues in commit messages to chosen issue tracker url
145 based on user defined regular expression
146 based on user defined regular expression
146 - added linking of changesets in commit messages
147 - added linking of changesets in commit messages
147 - new compact changelog with expandable commit messages
148 - new compact changelog with expandable commit messages
148 - firstname and lastname are optional in user creation
149 - firstname and lastname are optional in user creation
149 - #348 added post-create repository hook
150 - #348 added post-create repository hook
150 - #212 global encoding settings is now configurable from .ini files
151 - #212 global encoding settings is now configurable from .ini files
151 - #227 added repository groups permissions
152 - #227 added repository groups permissions
152 - markdown gets codehilite extensions
153 - markdown gets codehilite extensions
153 - new API methods, delete_repositories, grante/revoke permissions for groups
154 - new API methods, delete_repositories, grante/revoke permissions for groups
154 and repos
155 and repos
155
156
156
157
157 fixes
158 fixes
158 +++++
159 +++++
159
160
160 - rewrote dbsession management for atomic operations, and better error handling
161 - rewrote dbsession management for atomic operations, and better error handling
161 - fixed sorting of repo tables
162 - fixed sorting of repo tables
162 - #326 escape of special html entities in diffs
163 - #326 escape of special html entities in diffs
163 - normalized user_name => username in api attributes
164 - normalized user_name => username in api attributes
164 - fixes #298 ldap created users with mixed case emails created conflicts
165 - fixes #298 ldap created users with mixed case emails created conflicts
165 on saving a form
166 on saving a form
166 - fixes issue when owner of a repo couldn't revoke permissions for users
167 - fixes issue when owner of a repo couldn't revoke permissions for users
167 and groups
168 and groups
168 - fixes #271 rare JSON serialization problem with statistics
169 - fixes #271 rare JSON serialization problem with statistics
169 - fixes #337 missing validation check for conflicting names of a group with a
170 - fixes #337 missing validation check for conflicting names of a group with a
170 repositories group
171 repositories group
171 - #340 fixed session problem for mysql and celery tasks
172 - #340 fixed session problem for mysql and celery tasks
172 - fixed #331 RhodeCode mangles repository names if the a repository group
173 - fixed #331 RhodeCode mangles repository names if the a repository group
173 contains the "full path" to the repositories
174 contains the "full path" to the repositories
174 - #355 RhodeCode doesn't store encrypted LDAP passwords
175 - #355 RhodeCode doesn't store encrypted LDAP passwords
175
176
176 1.2.5 (**2012-01-28**)
177 1.2.5 (**2012-01-28**)
177 ----------------------
178 ----------------------
178
179
179 news
180 news
180 ++++
181 ++++
181
182
182 fixes
183 fixes
183 +++++
184 +++++
184
185
185 - #340 Celery complains about MySQL server gone away, added session cleanup
186 - #340 Celery complains about MySQL server gone away, added session cleanup
186 for celery tasks
187 for celery tasks
187 - #341 "scanning for repositories in None" log message during Rescan was missing
188 - #341 "scanning for repositories in None" log message during Rescan was missing
188 a parameter
189 a parameter
189 - fixed creating archives with subrepos. Some hooks were triggered during that
190 - fixed creating archives with subrepos. Some hooks were triggered during that
190 operation leading to crash.
191 operation leading to crash.
191 - fixed missing email in account page.
192 - fixed missing email in account page.
192 - Reverted Mercurial to 2.0.1 for windows due to bug in Mercurial that makes
193 - Reverted Mercurial to 2.0.1 for windows due to bug in Mercurial that makes
193 forking on windows impossible
194 forking on windows impossible
194
195
195 1.2.4 (**2012-01-19**)
196 1.2.4 (**2012-01-19**)
196 ----------------------
197 ----------------------
197
198
198 news
199 news
199 ++++
200 ++++
200
201
201 - RhodeCode is bundled with mercurial series 2.0.X by default, with
202 - RhodeCode is bundled with mercurial series 2.0.X by default, with
202 full support to largefiles extension. Enabled by default in new installations
203 full support to largefiles extension. Enabled by default in new installations
203 - #329 Ability to Add/Remove Groups to/from a Repository via AP
204 - #329 Ability to Add/Remove Groups to/from a Repository via AP
204 - added requires.txt file with requirements
205 - added requires.txt file with requirements
205
206
206 fixes
207 fixes
207 +++++
208 +++++
208
209
209 - fixes db session issues with celery when emailing admins
210 - fixes db session issues with celery when emailing admins
210 - #331 RhodeCode mangles repository names if the a repository group
211 - #331 RhodeCode mangles repository names if the a repository group
211 contains the "full path" to the repositories
212 contains the "full path" to the repositories
212 - #298 Conflicting e-mail addresses for LDAP and RhodeCode users
213 - #298 Conflicting e-mail addresses for LDAP and RhodeCode users
213 - DB session cleanup after hg protocol operations, fixes issues with
214 - DB session cleanup after hg protocol operations, fixes issues with
214 `mysql has gone away` errors
215 `mysql has gone away` errors
215 - #333 doc fixes for get_repo api function
216 - #333 doc fixes for get_repo api function
216 - #271 rare JSON serialization problem with statistics enabled
217 - #271 rare JSON serialization problem with statistics enabled
217 - #337 Fixes issues with validation of repository name conflicting with
218 - #337 Fixes issues with validation of repository name conflicting with
218 a group name. A proper message is now displayed.
219 a group name. A proper message is now displayed.
219 - #292 made ldap_dn in user edit readonly, to get rid of confusion that field
220 - #292 made ldap_dn in user edit readonly, to get rid of confusion that field
220 doesn't work
221 doesn't work
221 - #316 fixes issues with web description in hgrc files
222 - #316 fixes issues with web description in hgrc files
222
223
223 1.2.3 (**2011-11-02**)
224 1.2.3 (**2011-11-02**)
224 ----------------------
225 ----------------------
225
226
226 news
227 news
227 ++++
228 ++++
228
229
229 - added option to manage repos group for non admin users
230 - added option to manage repos group for non admin users
230 - added following API methods for get_users, create_user, get_users_groups,
231 - added following API methods for get_users, create_user, get_users_groups,
231 get_users_group, create_users_group, add_user_to_users_groups, get_repos,
232 get_users_group, create_users_group, add_user_to_users_groups, get_repos,
232 get_repo, create_repo, add_user_to_repo
233 get_repo, create_repo, add_user_to_repo
233 - implements #237 added password confirmation for my account
234 - implements #237 added password confirmation for my account
234 and admin edit user.
235 and admin edit user.
235 - implements #291 email notification for global events are now sent to all
236 - implements #291 email notification for global events are now sent to all
236 administrator users, and global config email.
237 administrator users, and global config email.
237
238
238 fixes
239 fixes
239 +++++
240 +++++
240
241
241 - added option for passing auth method for smtp mailer
242 - added option for passing auth method for smtp mailer
242 - #276 issue with adding a single user with id>10 to usergroups
243 - #276 issue with adding a single user with id>10 to usergroups
243 - #277 fixes windows LDAP settings in which missing values breaks the ldap auth
244 - #277 fixes windows LDAP settings in which missing values breaks the ldap auth
244 - #288 fixes managing of repos in a group for non admin user
245 - #288 fixes managing of repos in a group for non admin user
245
246
246 1.2.2 (**2011-10-17**)
247 1.2.2 (**2011-10-17**)
247 ----------------------
248 ----------------------
248
249
249 news
250 news
250 ++++
251 ++++
251
252
252 - #226 repo groups are available by path instead of numerical id
253 - #226 repo groups are available by path instead of numerical id
253
254
254 fixes
255 fixes
255 +++++
256 +++++
256
257
257 - #259 Groups with the same name but with different parent group
258 - #259 Groups with the same name but with different parent group
258 - #260 Put repo in group, then move group to another group -> repo becomes unavailable
259 - #260 Put repo in group, then move group to another group -> repo becomes unavailable
259 - #258 RhodeCode 1.2 assumes egg folder is writable (lockfiles problems)
260 - #258 RhodeCode 1.2 assumes egg folder is writable (lockfiles problems)
260 - #265 ldap save fails sometimes on converting attributes to booleans,
261 - #265 ldap save fails sometimes on converting attributes to booleans,
261 added getter and setter into model that will prevent from this on db model level
262 added getter and setter into model that will prevent from this on db model level
262 - fixed problems with timestamps issues #251 and #213
263 - fixed problems with timestamps issues #251 and #213
263 - fixes #266 RhodeCode allows to create repo with the same name and in
264 - fixes #266 RhodeCode allows to create repo with the same name and in
264 the same parent as group
265 the same parent as group
265 - fixes #245 Rescan of the repositories on Windows
266 - fixes #245 Rescan of the repositories on Windows
266 - fixes #248 cannot edit repos inside a group on windows
267 - fixes #248 cannot edit repos inside a group on windows
267 - fixes #219 forking problems on windows
268 - fixes #219 forking problems on windows
268
269
269 1.2.1 (**2011-10-08**)
270 1.2.1 (**2011-10-08**)
270 ----------------------
271 ----------------------
271
272
272 news
273 news
273 ++++
274 ++++
274
275
275
276
276 fixes
277 fixes
277 +++++
278 +++++
278
279
279 - fixed problems with basic auth and push problems
280 - fixed problems with basic auth and push problems
280 - gui fixes
281 - gui fixes
281 - fixed logger
282 - fixed logger
282
283
283 1.2.0 (**2011-10-07**)
284 1.2.0 (**2011-10-07**)
284 ----------------------
285 ----------------------
285
286
286 news
287 news
287 ++++
288 ++++
288
289
289 - implemented #47 repository groups
290 - implemented #47 repository groups
290 - implemented #89 Can setup google analytics code from settings menu
291 - implemented #89 Can setup google analytics code from settings menu
291 - implemented #91 added nicer looking archive urls with more download options
292 - implemented #91 added nicer looking archive urls with more download options
292 like tags, branches
293 like tags, branches
293 - implemented #44 into file browsing, and added follow branch option
294 - implemented #44 into file browsing, and added follow branch option
294 - implemented #84 downloads can be enabled/disabled for each repository
295 - implemented #84 downloads can be enabled/disabled for each repository
295 - anonymous repository can be cloned without having to pass default:default
296 - anonymous repository can be cloned without having to pass default:default
296 into clone url
297 into clone url
297 - fixed #90 whoosh indexer can index chooses repositories passed in command
298 - fixed #90 whoosh indexer can index chooses repositories passed in command
298 line
299 line
299 - extended journal with day aggregates and paging
300 - extended journal with day aggregates and paging
300 - implemented #107 source code lines highlight ranges
301 - implemented #107 source code lines highlight ranges
301 - implemented #93 customizable changelog on combined revision ranges -
302 - implemented #93 customizable changelog on combined revision ranges -
302 equivalent of githubs compare view
303 equivalent of githubs compare view
303 - implemented #108 extended and more powerful LDAP configuration
304 - implemented #108 extended and more powerful LDAP configuration
304 - implemented #56 users groups
305 - implemented #56 users groups
305 - major code rewrites optimized codes for speed and memory usage
306 - major code rewrites optimized codes for speed and memory usage
306 - raw and diff downloads are now in git format
307 - raw and diff downloads are now in git format
307 - setup command checks for write access to given path
308 - setup command checks for write access to given path
308 - fixed many issues with international characters and unicode. It uses utf8
309 - fixed many issues with international characters and unicode. It uses utf8
309 decode with replace to provide less errors even with non utf8 encoded strings
310 decode with replace to provide less errors even with non utf8 encoded strings
310 - #125 added API KEY access to feeds
311 - #125 added API KEY access to feeds
311 - #109 Repository can be created from external Mercurial link (aka. remote
312 - #109 Repository can be created from external Mercurial link (aka. remote
312 repository, and manually updated (via pull) from admin panel
313 repository, and manually updated (via pull) from admin panel
313 - beta git support - push/pull server + basic view for git repos
314 - beta git support - push/pull server + basic view for git repos
314 - added followers page and forks page
315 - added followers page and forks page
315 - server side file creation (with binary file upload interface)
316 - server side file creation (with binary file upload interface)
316 and edition with commits powered by codemirror
317 and edition with commits powered by codemirror
317 - #111 file browser file finder, quick lookup files on whole file tree
318 - #111 file browser file finder, quick lookup files on whole file tree
318 - added quick login sliding menu into main page
319 - added quick login sliding menu into main page
319 - changelog uses lazy loading of affected files details, in some scenarios
320 - changelog uses lazy loading of affected files details, in some scenarios
320 this can improve speed of changelog page dramatically especially for
321 this can improve speed of changelog page dramatically especially for
321 larger repositories.
322 larger repositories.
322 - implements #214 added support for downloading subrepos in download menu.
323 - implements #214 added support for downloading subrepos in download menu.
323 - Added basic API for direct operations on rhodecode via JSON
324 - Added basic API for direct operations on rhodecode via JSON
324 - Implemented advanced hook management
325 - Implemented advanced hook management
325
326
326 fixes
327 fixes
327 +++++
328 +++++
328
329
329 - fixed file browser bug, when switching into given form revision the url was
330 - fixed file browser bug, when switching into given form revision the url was
330 not changing
331 not changing
331 - fixed propagation to error controller on simplehg and simplegit middlewares
332 - fixed propagation to error controller on simplehg and simplegit middlewares
332 - fixed error when trying to make a download on empty repository
333 - fixed error when trying to make a download on empty repository
333 - fixed problem with '[' chars in commit messages in journal
334 - fixed problem with '[' chars in commit messages in journal
334 - fixed #99 Unicode errors, on file node paths with non utf-8 characters
335 - fixed #99 Unicode errors, on file node paths with non utf-8 characters
335 - journal fork fixes
336 - journal fork fixes
336 - removed issue with space inside renamed repository after deletion
337 - removed issue with space inside renamed repository after deletion
337 - fixed strange issue on formencode imports
338 - fixed strange issue on formencode imports
338 - fixed #126 Deleting repository on Windows, rename used incompatible chars.
339 - fixed #126 Deleting repository on Windows, rename used incompatible chars.
339 - #150 fixes for errors on repositories mapped in db but corrupted in
340 - #150 fixes for errors on repositories mapped in db but corrupted in
340 filesystem
341 filesystem
341 - fixed problem with ascendant characters in realm #181
342 - fixed problem with ascendant characters in realm #181
342 - fixed problem with sqlite file based database connection pool
343 - fixed problem with sqlite file based database connection pool
343 - whoosh indexer and code stats share the same dynamic extensions map
344 - whoosh indexer and code stats share the same dynamic extensions map
344 - fixes #188 - relationship delete of repo_to_perm entry on user removal
345 - fixes #188 - relationship delete of repo_to_perm entry on user removal
345 - fixes issue #189 Trending source files shows "show more" when no more exist
346 - fixes issue #189 Trending source files shows "show more" when no more exist
346 - fixes issue #197 Relative paths for pidlocks
347 - fixes issue #197 Relative paths for pidlocks
347 - fixes issue #198 password will require only 3 chars now for login form
348 - fixes issue #198 password will require only 3 chars now for login form
348 - fixes issue #199 wrong redirection for non admin users after creating a repository
349 - fixes issue #199 wrong redirection for non admin users after creating a repository
349 - fixes issues #202, bad db constraint made impossible to attach same group
350 - fixes issues #202, bad db constraint made impossible to attach same group
350 more than one time. Affects only mysql/postgres
351 more than one time. Affects only mysql/postgres
351 - fixes #218 os.kill patch for windows was missing sig param
352 - fixes #218 os.kill patch for windows was missing sig param
352 - improved rendering of dag (they are not trimmed anymore when number of
353 - improved rendering of dag (they are not trimmed anymore when number of
353 heads exceeds 5)
354 heads exceeds 5)
354
355
355 1.1.8 (**2011-04-12**)
356 1.1.8 (**2011-04-12**)
356 ----------------------
357 ----------------------
357
358
358 news
359 news
359 ++++
360 ++++
360
361
361 - improved windows support
362 - improved windows support
362
363
363 fixes
364 fixes
364 +++++
365 +++++
365
366
366 - fixed #140 freeze of python dateutil library, since new version is python2.x
367 - fixed #140 freeze of python dateutil library, since new version is python2.x
367 incompatible
368 incompatible
368 - setup-app will check for write permission in given path
369 - setup-app will check for write permission in given path
369 - cleaned up license info issue #149
370 - cleaned up license info issue #149
370 - fixes for issues #137,#116 and problems with unicode and accented characters.
371 - fixes for issues #137,#116 and problems with unicode and accented characters.
371 - fixes crashes on gravatar, when passed in email as unicode
372 - fixes crashes on gravatar, when passed in email as unicode
372 - fixed tooltip flickering problems
373 - fixed tooltip flickering problems
373 - fixed came_from redirection on windows
374 - fixed came_from redirection on windows
374 - fixed logging modules, and sql formatters
375 - fixed logging modules, and sql formatters
375 - windows fixes for os.kill issue #133
376 - windows fixes for os.kill issue #133
376 - fixes path splitting for windows issues #148
377 - fixes path splitting for windows issues #148
377 - fixed issue #143 wrong import on migration to 1.1.X
378 - fixed issue #143 wrong import on migration to 1.1.X
378 - fixed problems with displaying binary files, thanks to Thomas Waldmann
379 - fixed problems with displaying binary files, thanks to Thomas Waldmann
379 - removed name from archive files since it's breaking ui for long repo names
380 - removed name from archive files since it's breaking ui for long repo names
380 - fixed issue with archive headers sent to browser, thanks to Thomas Waldmann
381 - fixed issue with archive headers sent to browser, thanks to Thomas Waldmann
381 - fixed compatibility for 1024px displays, and larger dpi settings, thanks to
382 - fixed compatibility for 1024px displays, and larger dpi settings, thanks to
382 Thomas Waldmann
383 Thomas Waldmann
383 - fixed issue #166 summary pager was skipping 10 revisions on second page
384 - fixed issue #166 summary pager was skipping 10 revisions on second page
384
385
385
386
386 1.1.7 (**2011-03-23**)
387 1.1.7 (**2011-03-23**)
387 ----------------------
388 ----------------------
388
389
389 news
390 news
390 ++++
391 ++++
391
392
392 fixes
393 fixes
393 +++++
394 +++++
394
395
395 - fixed (again) #136 installation support for FreeBSD
396 - fixed (again) #136 installation support for FreeBSD
396
397
397
398
398 1.1.6 (**2011-03-21**)
399 1.1.6 (**2011-03-21**)
399 ----------------------
400 ----------------------
400
401
401 news
402 news
402 ++++
403 ++++
403
404
404 fixes
405 fixes
405 +++++
406 +++++
406
407
407 - fixed #136 installation support for FreeBSD
408 - fixed #136 installation support for FreeBSD
408 - RhodeCode will check for python version during installation
409 - RhodeCode will check for python version during installation
409
410
410 1.1.5 (**2011-03-17**)
411 1.1.5 (**2011-03-17**)
411 ----------------------
412 ----------------------
412
413
413 news
414 news
414 ++++
415 ++++
415
416
416 - basic windows support, by exchanging pybcrypt into sha256 for windows only
417 - basic windows support, by exchanging pybcrypt into sha256 for windows only
417 highly inspired by idea of mantis406
418 highly inspired by idea of mantis406
418
419
419 fixes
420 fixes
420 +++++
421 +++++
421
422
422 - fixed sorting by author in main page
423 - fixed sorting by author in main page
423 - fixed crashes with diffs on binary files
424 - fixed crashes with diffs on binary files
424 - fixed #131 problem with boolean values for LDAP
425 - fixed #131 problem with boolean values for LDAP
425 - fixed #122 mysql problems thanks to striker69
426 - fixed #122 mysql problems thanks to striker69
426 - fixed problem with errors on calling raw/raw_files/annotate functions
427 - fixed problem with errors on calling raw/raw_files/annotate functions
427 with unknown revisions
428 with unknown revisions
428 - fixed returned rawfiles attachment names with international character
429 - fixed returned rawfiles attachment names with international character
429 - cleaned out docs, big thanks to Jason Harris
430 - cleaned out docs, big thanks to Jason Harris
430
431
431 1.1.4 (**2011-02-19**)
432 1.1.4 (**2011-02-19**)
432 ----------------------
433 ----------------------
433
434
434 news
435 news
435 ++++
436 ++++
436
437
437 fixes
438 fixes
438 +++++
439 +++++
439
440
440 - fixed formencode import problem on settings page, that caused server crash
441 - fixed formencode import problem on settings page, that caused server crash
441 when that page was accessed as first after server start
442 when that page was accessed as first after server start
442 - journal fixes
443 - journal fixes
443 - fixed option to access repository just by entering http://server/<repo_name>
444 - fixed option to access repository just by entering http://server/<repo_name>
444
445
445 1.1.3 (**2011-02-16**)
446 1.1.3 (**2011-02-16**)
446 ----------------------
447 ----------------------
447
448
448 news
449 news
449 ++++
450 ++++
450
451
451 - implemented #102 allowing the '.' character in username
452 - implemented #102 allowing the '.' character in username
452 - added option to access repository just by entering http://server/<repo_name>
453 - added option to access repository just by entering http://server/<repo_name>
453 - celery task ignores result for better performance
454 - celery task ignores result for better performance
454
455
455 fixes
456 fixes
456 +++++
457 +++++
457
458
458 - fixed ehlo command and non auth mail servers on smtp_lib. Thanks to
459 - fixed ehlo command and non auth mail servers on smtp_lib. Thanks to
459 apollo13 and Johan Walles
460 apollo13 and Johan Walles
460 - small fixes in journal
461 - small fixes in journal
461 - fixed problems with getting setting for celery from .ini files
462 - fixed problems with getting setting for celery from .ini files
462 - registration, password reset and login boxes share the same title as main
463 - registration, password reset and login boxes share the same title as main
463 application now
464 application now
464 - fixed #113: to high permissions to fork repository
465 - fixed #113: to high permissions to fork repository
465 - fixed problem with '[' chars in commit messages in journal
466 - fixed problem with '[' chars in commit messages in journal
466 - removed issue with space inside renamed repository after deletion
467 - removed issue with space inside renamed repository after deletion
467 - db transaction fixes when filesystem repository creation failed
468 - db transaction fixes when filesystem repository creation failed
468 - fixed #106 relation issues on databases different than sqlite
469 - fixed #106 relation issues on databases different than sqlite
469 - fixed static files paths links to use of url() method
470 - fixed static files paths links to use of url() method
470
471
471 1.1.2 (**2011-01-12**)
472 1.1.2 (**2011-01-12**)
472 ----------------------
473 ----------------------
473
474
474 news
475 news
475 ++++
476 ++++
476
477
477
478
478 fixes
479 fixes
479 +++++
480 +++++
480
481
481 - fixes #98 protection against float division of percentage stats
482 - fixes #98 protection against float division of percentage stats
482 - fixed graph bug
483 - fixed graph bug
483 - forced webhelpers version since it was making troubles during installation
484 - forced webhelpers version since it was making troubles during installation
484
485
485 1.1.1 (**2011-01-06**)
486 1.1.1 (**2011-01-06**)
486 ----------------------
487 ----------------------
487
488
488 news
489 news
489 ++++
490 ++++
490
491
491 - added force https option into ini files for easier https usage (no need to
492 - added force https option into ini files for easier https usage (no need to
492 set server headers with this options)
493 set server headers with this options)
493 - small css updates
494 - small css updates
494
495
495 fixes
496 fixes
496 +++++
497 +++++
497
498
498 - fixed #96 redirect loop on files view on repositories without changesets
499 - fixed #96 redirect loop on files view on repositories without changesets
499 - fixed #97 unicode string passed into server header in special cases (mod_wsgi)
500 - fixed #97 unicode string passed into server header in special cases (mod_wsgi)
500 and server crashed with errors
501 and server crashed with errors
501 - fixed large tooltips problems on main page
502 - fixed large tooltips problems on main page
502 - fixed #92 whoosh indexer is more error proof
503 - fixed #92 whoosh indexer is more error proof
503
504
504 1.1.0 (**2010-12-18**)
505 1.1.0 (**2010-12-18**)
505 ----------------------
506 ----------------------
506
507
507 news
508 news
508 ++++
509 ++++
509
510
510 - rewrite of internals for vcs >=0.1.10
511 - rewrite of internals for vcs >=0.1.10
511 - uses mercurial 1.7 with dotencode disabled for maintaining compatibility
512 - uses mercurial 1.7 with dotencode disabled for maintaining compatibility
512 with older clients
513 with older clients
513 - anonymous access, authentication via ldap
514 - anonymous access, authentication via ldap
514 - performance upgrade for cached repos list - each repository has its own
515 - performance upgrade for cached repos list - each repository has its own
515 cache that's invalidated when needed.
516 cache that's invalidated when needed.
516 - performance upgrades on repositories with large amount of commits (20K+)
517 - performance upgrades on repositories with large amount of commits (20K+)
517 - main page quick filter for filtering repositories
518 - main page quick filter for filtering repositories
518 - user dashboards with ability to follow chosen repositories actions
519 - user dashboards with ability to follow chosen repositories actions
519 - sends email to admin on new user registration
520 - sends email to admin on new user registration
520 - added cache/statistics reset options into repository settings
521 - added cache/statistics reset options into repository settings
521 - more detailed action logger (based on hooks) with pushed changesets lists
522 - more detailed action logger (based on hooks) with pushed changesets lists
522 and options to disable those hooks from admin panel
523 and options to disable those hooks from admin panel
523 - introduced new enhanced changelog for merges that shows more accurate results
524 - introduced new enhanced changelog for merges that shows more accurate results
524 - new improved and faster code stats (based on pygments lexers mapping tables,
525 - new improved and faster code stats (based on pygments lexers mapping tables,
525 showing up to 10 trending sources for each repository. Additionally stats
526 showing up to 10 trending sources for each repository. Additionally stats
526 can be disabled in repository settings.
527 can be disabled in repository settings.
527 - gui optimizations, fixed application width to 1024px
528 - gui optimizations, fixed application width to 1024px
528 - added cut off (for large files/changesets) limit into config files
529 - added cut off (for large files/changesets) limit into config files
529 - whoosh, celeryd, upgrade moved to paster command
530 - whoosh, celeryd, upgrade moved to paster command
530 - other than sqlite database backends can be used
531 - other than sqlite database backends can be used
531
532
532 fixes
533 fixes
533 +++++
534 +++++
534
535
535 - fixes #61 forked repo was showing only after cache expired
536 - fixes #61 forked repo was showing only after cache expired
536 - fixes #76 no confirmation on user deletes
537 - fixes #76 no confirmation on user deletes
537 - fixes #66 Name field misspelled
538 - fixes #66 Name field misspelled
538 - fixes #72 block user removal when he owns repositories
539 - fixes #72 block user removal when he owns repositories
539 - fixes #69 added password confirmation fields
540 - fixes #69 added password confirmation fields
540 - fixes #87 RhodeCode crashes occasionally on updating repository owner
541 - fixes #87 RhodeCode crashes occasionally on updating repository owner
541 - fixes #82 broken annotations on files with more than 1 blank line at the end
542 - fixes #82 broken annotations on files with more than 1 blank line at the end
542 - a lot of fixes and tweaks for file browser
543 - a lot of fixes and tweaks for file browser
543 - fixed detached session issues
544 - fixed detached session issues
544 - fixed when user had no repos he would see all repos listed in my account
545 - fixed when user had no repos he would see all repos listed in my account
545 - fixed ui() instance bug when global hgrc settings was loaded for server
546 - fixed ui() instance bug when global hgrc settings was loaded for server
546 instance and all hgrc options were merged with our db ui() object
547 instance and all hgrc options were merged with our db ui() object
547 - numerous small bugfixes
548 - numerous small bugfixes
548
549
549 (special thanks for TkSoh for detailed feedback)
550 (special thanks for TkSoh for detailed feedback)
550
551
551
552
552 1.0.2 (**2010-11-12**)
553 1.0.2 (**2010-11-12**)
553 ----------------------
554 ----------------------
554
555
555 news
556 news
556 ++++
557 ++++
557
558
558 - tested under python2.7
559 - tested under python2.7
559 - bumped sqlalchemy and celery versions
560 - bumped sqlalchemy and celery versions
560
561
561 fixes
562 fixes
562 +++++
563 +++++
563
564
564 - fixed #59 missing graph.js
565 - fixed #59 missing graph.js
565 - fixed repo_size crash when repository had broken symlinks
566 - fixed repo_size crash when repository had broken symlinks
566 - fixed python2.5 crashes.
567 - fixed python2.5 crashes.
567
568
568
569
569 1.0.1 (**2010-11-10**)
570 1.0.1 (**2010-11-10**)
570 ----------------------
571 ----------------------
571
572
572 news
573 news
573 ++++
574 ++++
574
575
575 - small css updated
576 - small css updated
576
577
577 fixes
578 fixes
578 +++++
579 +++++
579
580
580 - fixed #53 python2.5 incompatible enumerate calls
581 - fixed #53 python2.5 incompatible enumerate calls
581 - fixed #52 disable mercurial extension for web
582 - fixed #52 disable mercurial extension for web
582 - fixed #51 deleting repositories don't delete it's dependent objects
583 - fixed #51 deleting repositories don't delete it's dependent objects
583
584
584
585
585 1.0.0 (**2010-11-02**)
586 1.0.0 (**2010-11-02**)
586 ----------------------
587 ----------------------
587
588
588 - security bugfix simplehg wasn't checking for permissions on commands
589 - security bugfix simplehg wasn't checking for permissions on commands
589 other than pull or push.
590 other than pull or push.
590 - fixed doubled messages after push or pull in admin journal
591 - fixed doubled messages after push or pull in admin journal
591 - templating and css corrections, fixed repo switcher on chrome, updated titles
592 - templating and css corrections, fixed repo switcher on chrome, updated titles
592 - admin menu accessible from options menu on repository view
593 - admin menu accessible from options menu on repository view
593 - permissions cached queries
594 - permissions cached queries
594
595
595 1.0.0rc4 (**2010-10-12**)
596 1.0.0rc4 (**2010-10-12**)
596 --------------------------
597 --------------------------
597
598
598 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
599 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
599 - removed cache_manager settings from sqlalchemy meta
600 - removed cache_manager settings from sqlalchemy meta
600 - added sqlalchemy cache settings to ini files
601 - added sqlalchemy cache settings to ini files
601 - validated password length and added second try of failure on paster setup-app
602 - validated password length and added second try of failure on paster setup-app
602 - fixed setup database destroy prompt even when there was no db
603 - fixed setup database destroy prompt even when there was no db
603
604
604
605
605 1.0.0rc3 (**2010-10-11**)
606 1.0.0rc3 (**2010-10-11**)
606 -------------------------
607 -------------------------
607
608
608 - fixed i18n during installation.
609 - fixed i18n during installation.
609
610
610 1.0.0rc2 (**2010-10-11**)
611 1.0.0rc2 (**2010-10-11**)
611 -------------------------
612 -------------------------
612
613
613 - Disabled dirsize in file browser, it's causing nasty bug when dir renames
614 - Disabled dirsize in file browser, it's causing nasty bug when dir renames
614 occure. After vcs is fixed it'll be put back again.
615 occure. After vcs is fixed it'll be put back again.
615 - templating/css rewrites, optimized css. No newline at end of file
616 - templating/css rewrites, optimized css.
@@ -1,174 +1,180 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 rhodecode.controllers.forks
3 rhodecode.controllers.forks
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
5
6 forks controller for rhodecode
6 forks controller for rhodecode
7
7
8 :created_on: Apr 23, 2011
8 :created_on: Apr 23, 2011
9 :author: marcink
9 :author: marcink
10 :copyright: (C) 2011-2012 Marcin Kuzminski <marcin@python-works.com>
10 :copyright: (C) 2011-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 import logging
25 import logging
26 import formencode
26 import formencode
27 import traceback
27 import traceback
28 from formencode import htmlfill
28 from formencode import htmlfill
29
29
30 from pylons import tmpl_context as c, request, url
30 from pylons import tmpl_context as c, request, url
31 from pylons.controllers.util import redirect
31 from pylons.controllers.util import redirect
32 from pylons.i18n.translation import _
32 from pylons.i18n.translation import _
33
33
34 import rhodecode.lib.helpers as h
34 import rhodecode.lib.helpers as h
35
35
36 from rhodecode.lib.helpers import Page
36 from rhodecode.lib.helpers import Page
37 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator, \
37 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator, \
38 NotAnonymous
38 NotAnonymous, HasRepoPermissionAny
39 from rhodecode.lib.base import BaseRepoController, render
39 from rhodecode.lib.base import BaseRepoController, render
40 from rhodecode.model.db import Repository, RepoGroup, UserFollowing, User
40 from rhodecode.model.db import Repository, RepoGroup, UserFollowing, User
41 from rhodecode.model.repo import RepoModel
41 from rhodecode.model.repo import RepoModel
42 from rhodecode.model.forms import RepoForkForm
42 from rhodecode.model.forms import RepoForkForm
43
43
44 log = logging.getLogger(__name__)
44 log = logging.getLogger(__name__)
45
45
46
46
47 class ForksController(BaseRepoController):
47 class ForksController(BaseRepoController):
48
48
49 @LoginRequired()
49 @LoginRequired()
50 def __before__(self):
50 def __before__(self):
51 super(ForksController, self).__before__()
51 super(ForksController, self).__before__()
52
52
53 def __load_defaults(self):
53 def __load_defaults(self):
54 c.repo_groups = RepoGroup.groups_choices()
54 c.repo_groups = RepoGroup.groups_choices()
55 c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups)
55 c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups)
56
56
57 def __load_data(self, repo_name=None):
57 def __load_data(self, repo_name=None):
58 """
58 """
59 Load defaults settings for edit, and update
59 Load defaults settings for edit, and update
60
60
61 :param repo_name:
61 :param repo_name:
62 """
62 """
63 self.__load_defaults()
63 self.__load_defaults()
64
64
65 c.repo_info = db_repo = Repository.get_by_repo_name(repo_name)
65 c.repo_info = db_repo = Repository.get_by_repo_name(repo_name)
66 repo = db_repo.scm_instance
66 repo = db_repo.scm_instance
67
67
68 if c.repo_info is None:
68 if c.repo_info is None:
69 h.flash(_('%s repository is not mapped to db perhaps'
69 h.flash(_('%s repository is not mapped to db perhaps'
70 ' it was created or renamed from the filesystem'
70 ' it was created or renamed from the filesystem'
71 ' please run the application again'
71 ' please run the application again'
72 ' in order to rescan repositories') % repo_name,
72 ' in order to rescan repositories') % repo_name,
73 category='error')
73 category='error')
74
74
75 return redirect(url('repos'))
75 return redirect(url('repos'))
76
76
77 c.default_user_id = User.get_by_username('default').user_id
77 c.default_user_id = User.get_by_username('default').user_id
78 c.in_public_journal = UserFollowing.query()\
78 c.in_public_journal = UserFollowing.query()\
79 .filter(UserFollowing.user_id == c.default_user_id)\
79 .filter(UserFollowing.user_id == c.default_user_id)\
80 .filter(UserFollowing.follows_repository == c.repo_info).scalar()
80 .filter(UserFollowing.follows_repository == c.repo_info).scalar()
81
81
82 if c.repo_info.stats:
82 if c.repo_info.stats:
83 last_rev = c.repo_info.stats.stat_on_revision+1
83 last_rev = c.repo_info.stats.stat_on_revision+1
84 else:
84 else:
85 last_rev = 0
85 last_rev = 0
86 c.stats_revision = last_rev
86 c.stats_revision = last_rev
87
87
88 c.repo_last_rev = repo.count() if repo.revisions else 0
88 c.repo_last_rev = repo.count() if repo.revisions else 0
89
89
90 if last_rev == 0 or c.repo_last_rev == 0:
90 if last_rev == 0 or c.repo_last_rev == 0:
91 c.stats_percentage = 0
91 c.stats_percentage = 0
92 else:
92 else:
93 c.stats_percentage = '%.2f' % ((float((last_rev)) /
93 c.stats_percentage = '%.2f' % ((float((last_rev)) /
94 c.repo_last_rev) * 100)
94 c.repo_last_rev) * 100)
95
95
96 defaults = RepoModel()._get_defaults(repo_name)
96 defaults = RepoModel()._get_defaults(repo_name)
97 # add prefix to fork
97 # add prefix to fork
98 defaults['repo_name'] = 'fork-' + defaults['repo_name']
98 defaults['repo_name'] = 'fork-' + defaults['repo_name']
99 return defaults
99 return defaults
100
100
101 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
101 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
102 'repository.admin')
102 'repository.admin')
103 def forks(self, repo_name):
103 def forks(self, repo_name):
104 p = int(request.params.get('page', 1))
104 p = int(request.params.get('page', 1))
105 repo_id = c.rhodecode_db_repo.repo_id
105 repo_id = c.rhodecode_db_repo.repo_id
106 d = Repository.get_repo_forks(repo_id)
106 d = []
107 for r in Repository.get_repo_forks(repo_id):
108 if not HasRepoPermissionAny(
109 'repository.read', 'repository.write', 'repository.admin'
110 )(r.repo_name, 'get forks check'):
111 continue
112 d.append(r)
107 c.forks_pager = Page(d, page=p, items_per_page=20)
113 c.forks_pager = Page(d, page=p, items_per_page=20)
108
114
109 c.forks_data = render('/forks/forks_data.html')
115 c.forks_data = render('/forks/forks_data.html')
110
116
111 if request.environ.get('HTTP_X_PARTIAL_XHR'):
117 if request.environ.get('HTTP_X_PARTIAL_XHR'):
112 return c.forks_data
118 return c.forks_data
113
119
114 return render('/forks/forks.html')
120 return render('/forks/forks.html')
115
121
116 @NotAnonymous()
122 @NotAnonymous()
117 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
123 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
118 'repository.admin')
124 'repository.admin')
119 def fork(self, repo_name):
125 def fork(self, repo_name):
120 c.repo_info = Repository.get_by_repo_name(repo_name)
126 c.repo_info = Repository.get_by_repo_name(repo_name)
121 if not c.repo_info:
127 if not c.repo_info:
122 h.flash(_('%s repository is not mapped to db perhaps'
128 h.flash(_('%s repository is not mapped to db perhaps'
123 ' it was created or renamed from the file system'
129 ' it was created or renamed from the file system'
124 ' please run the application again'
130 ' please run the application again'
125 ' in order to rescan repositories') % repo_name,
131 ' in order to rescan repositories') % repo_name,
126 category='error')
132 category='error')
127
133
128 return redirect(url('home'))
134 return redirect(url('home'))
129
135
130 defaults = self.__load_data(repo_name)
136 defaults = self.__load_data(repo_name)
131
137
132 return htmlfill.render(
138 return htmlfill.render(
133 render('forks/fork.html'),
139 render('forks/fork.html'),
134 defaults=defaults,
140 defaults=defaults,
135 encoding="UTF-8",
141 encoding="UTF-8",
136 force_defaults=False
142 force_defaults=False
137 )
143 )
138
144
139
145
140 @NotAnonymous()
146 @NotAnonymous()
141 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
147 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
142 'repository.admin')
148 'repository.admin')
143 def fork_create(self, repo_name):
149 def fork_create(self, repo_name):
144 self.__load_defaults()
150 self.__load_defaults()
145 c.repo_info = Repository.get_by_repo_name(repo_name)
151 c.repo_info = Repository.get_by_repo_name(repo_name)
146 _form = RepoForkForm(old_data={'repo_type': c.repo_info.repo_type},
152 _form = RepoForkForm(old_data={'repo_type': c.repo_info.repo_type},
147 repo_groups=c.repo_groups_choices,)()
153 repo_groups=c.repo_groups_choices,)()
148 form_result = {}
154 form_result = {}
149 try:
155 try:
150 form_result = _form.to_python(dict(request.POST))
156 form_result = _form.to_python(dict(request.POST))
151 # add org_path of repo so we can do a clone from it later
157 # add org_path of repo so we can do a clone from it later
152 form_result['org_path'] = c.repo_info.repo_name
158 form_result['org_path'] = c.repo_info.repo_name
153
159
154 # create fork is done sometimes async on celery, db transaction
160 # create fork is done sometimes async on celery, db transaction
155 # management is handled there.
161 # management is handled there.
156 RepoModel().create_fork(form_result, self.rhodecode_user)
162 RepoModel().create_fork(form_result, self.rhodecode_user)
157 h.flash(_('forked %s repository as %s') \
163 h.flash(_('forked %s repository as %s') \
158 % (repo_name, form_result['repo_name']),
164 % (repo_name, form_result['repo_name']),
159 category='success')
165 category='success')
160 except formencode.Invalid, errors:
166 except formencode.Invalid, errors:
161 c.new_repo = errors.value['repo_name']
167 c.new_repo = errors.value['repo_name']
162
168
163 return htmlfill.render(
169 return htmlfill.render(
164 render('forks/fork.html'),
170 render('forks/fork.html'),
165 defaults=errors.value,
171 defaults=errors.value,
166 errors=errors.error_dict or {},
172 errors=errors.error_dict or {},
167 prefix_error=False,
173 prefix_error=False,
168 encoding="UTF-8")
174 encoding="UTF-8")
169 except Exception:
175 except Exception:
170 log.error(traceback.format_exc())
176 log.error(traceback.format_exc())
171 h.flash(_('An error occurred during repository forking %s') %
177 h.flash(_('An error occurred during repository forking %s') %
172 repo_name, category='error')
178 repo_name, category='error')
173
179
174 return redirect(url('home'))
180 return redirect(url('home'))
@@ -1,86 +1,133 b''
1 from rhodecode.tests import *
1 from rhodecode.tests import *
2
2
3 from rhodecode.model.db import Repository
3 from rhodecode.model.db import Repository
4 from rhodecode.model.repo import RepoModel
5 from rhodecode.model.user import UserModel
6
4
7
5 class TestForksController(TestController):
8 class TestForksController(TestController):
6
9
10 def setUp(self):
11 self.username = u'forkuser'
12 self.password = u'qweqwe'
13 self.u1 = UserModel().create_or_update(
14 username=self.username, password=self.password,
15 email=u'fork_king@rhodecode.org', name=u'u1', lastname=u'u1'
16 )
17 self.Session.commit()
18
19 def tearDown(self):
20 self.Session.delete(self.u1)
21 self.Session.commit()
22
7 def test_index(self):
23 def test_index(self):
8 self.log_user()
24 self.log_user()
9 repo_name = HG_REPO
25 repo_name = HG_REPO
10 response = self.app.get(url(controller='forks', action='forks',
26 response = self.app.get(url(controller='forks', action='forks',
11 repo_name=repo_name))
27 repo_name=repo_name))
12
28
13 self.assertTrue("""There are no forks yet""" in response.body)
29 self.assertTrue("""There are no forks yet""" in response.body)
14
30
15
16 def test_index_with_fork(self):
31 def test_index_with_fork(self):
17 self.log_user()
32 self.log_user()
18
33
19 # create a fork
34 # create a fork
20 fork_name = HG_FORK
35 fork_name = HG_FORK
21 description = 'fork of vcs test'
36 description = 'fork of vcs test'
22 repo_name = HG_REPO
37 repo_name = HG_REPO
23 org_repo = Repository.get_by_repo_name(repo_name)
38 org_repo = Repository.get_by_repo_name(repo_name)
24 response = self.app.post(url(controller='forks',
39 response = self.app.post(url(controller='forks',
25 action='fork_create',
40 action='fork_create',
26 repo_name=repo_name),
41 repo_name=repo_name),
27 {'repo_name':fork_name,
42 {'repo_name':fork_name,
28 'repo_group':'',
43 'repo_group':'',
29 'fork_parent_id':org_repo.repo_id,
44 'fork_parent_id':org_repo.repo_id,
30 'repo_type':'hg',
45 'repo_type':'hg',
31 'description':description,
46 'description':description,
32 'private':'False'})
47 'private':'False'})
33
48
34 response = self.app.get(url(controller='forks', action='forks',
49 response = self.app.get(url(controller='forks', action='forks',
35 repo_name=repo_name))
50 repo_name=repo_name))
36
51
37
38 self.assertTrue("""<a href="/%s/summary">"""
52 self.assertTrue("""<a href="/%s/summary">"""
39 """vcs_test_hg_fork</a>""" % fork_name
53 """vcs_test_hg_fork</a>""" % fork_name
40 in response.body)
54 in response.body)
41
55
42 #remove this fork
56 #remove this fork
43 response = self.app.delete(url('repo', repo_name=fork_name))
57 response = self.app.delete(url('repo', repo_name=fork_name))
44
58
45
46
47
48 def test_z_fork_create(self):
59 def test_z_fork_create(self):
49 self.log_user()
60 self.log_user()
50 fork_name = HG_FORK
61 fork_name = HG_FORK
51 description = 'fork of vcs test'
62 description = 'fork of vcs test'
52 repo_name = HG_REPO
63 repo_name = HG_REPO
53 org_repo = Repository.get_by_repo_name(repo_name)
64 org_repo = Repository.get_by_repo_name(repo_name)
54 response = self.app.post(url(controller='forks', action='fork_create',
65 response = self.app.post(url(controller='forks', action='fork_create',
55 repo_name=repo_name),
66 repo_name=repo_name),
56 {'repo_name':fork_name,
67 {'repo_name':fork_name,
57 'repo_group':'',
68 'repo_group':'',
58 'fork_parent_id':org_repo.repo_id,
69 'fork_parent_id':org_repo.repo_id,
59 'repo_type':'hg',
70 'repo_type':'hg',
60 'description':description,
71 'description':description,
61 'private':'False'})
72 'private':'False'})
62
73
63 #test if we have a message that fork is ok
74 #test if we have a message that fork is ok
64 self.assertTrue('forked %s repository as %s' \
75 self.assertTrue('forked %s repository as %s' \
65 % (repo_name, fork_name) in response.session['flash'][0])
76 % (repo_name, fork_name) in response.session['flash'][0])
66
77
67 #test if the fork was created in the database
78 #test if the fork was created in the database
68 fork_repo = self.Session.query(Repository)\
79 fork_repo = self.Session.query(Repository)\
69 .filter(Repository.repo_name == fork_name).one()
80 .filter(Repository.repo_name == fork_name).one()
70
81
71 self.assertEqual(fork_repo.repo_name, fork_name)
82 self.assertEqual(fork_repo.repo_name, fork_name)
72 self.assertEqual(fork_repo.fork.repo_name, repo_name)
83 self.assertEqual(fork_repo.fork.repo_name, repo_name)
73
84
74
75 #test if fork is visible in the list ?
85 #test if fork is visible in the list ?
76 response = response.follow()
86 response = response.follow()
77
87
78
79 # check if fork is marked as fork
88 # check if fork is marked as fork
80 # wait for cache to expire
89 # wait for cache to expire
81 import time
90 import time
82 time.sleep(10)
91 time.sleep(10)
83 response = self.app.get(url(controller='summary', action='index',
92 response = self.app.get(url(controller='summary', action='index',
84 repo_name=fork_name))
93 repo_name=fork_name))
85
94
86 self.assertTrue('Fork of %s' % repo_name in response.body)
95 self.assertTrue('Fork of %s' % repo_name in response.body)
96
97 def test_zz_fork_permission_page(self):
98 usr = self.log_user(self.username, self.password)['user_id']
99 repo_name = HG_REPO
100
101 forks = self.Session.query(Repository)\
102 .filter(Repository.fork_id != None)\
103 .all()
104 self.assertEqual(1, len(forks))
105
106 # set read permissions for this
107 RepoModel().grant_user_permission(repo=forks[0],
108 user=usr,
109 perm='repository.read')
110 self.Session.commit()
111
112 response = self.app.get(url(controller='forks', action='forks',
113 repo_name=repo_name))
114
115 response.mustcontain('<div style="padding:5px 3px 3px 42px;">fork of vcs test</div>')
116
117 def test_zzz_fork_permission_page(self):
118 usr = self.log_user(self.username, self.password)['user_id']
119 repo_name = HG_REPO
120
121 forks = self.Session.query(Repository)\
122 .filter(Repository.fork_id != None)\
123 .all()
124 self.assertEqual(1, len(forks))
125
126 # set none
127 RepoModel().grant_user_permission(repo=forks[0],
128 user=usr, perm='repository.none')
129 self.Session.commit()
130 # fork shouldn't be there
131 response = self.app.get(url(controller='forks', action='forks',
132 repo_name=repo_name))
133 response.mustcontain('There are no forks yet')
General Comments 0
You need to be logged in to leave comments. Login now