Menu

Trac Commit Log


Commit Date  
[r7335] by cboos

WikiRename: added unit-test for `WikiPage.rename`.

- set correctly the `WikiPage.name` property after the rename
- add `old_name` parameter to `page_renamed` listener method

2008-07-08 13:23:16 Tree
[r7334] by cboos

WikiRename (rebasing r6422): add a method to the model for renaming a wiki page in-place.

New methods:
- `WikiPage.rename(self, new_name, db=None)`
- `Attachment.reparent_all(cls, env, old_realm, old_id, new_realm, new_id, db)`

Implementation note for `Attachment.reparent_all`: we move files individually instead of the whole folder, because:
1. this will work even if the new resource already exists (e.g. for merges)
2. it's complex when the new resource is a sub-folder if the old one
3. it's simply not possible in the general case (e.g. when the new page doesn'titself exist, but there are already sub-folders)

Note also that it's because of 3. (sub-folders may exists) that we don't remove the old attachment folder after the reparent.

2008-07-08 12:52:01 Tree
[r7333] by cboos

WikiRename (rebasing r6421): simplify transaction handling in the Wiki model

The !WikiPage public API is not modified. A helper `transaction` function is used to factor out the `handle_ta` business. Its usage is very simple:
- if the function is given a database connection, it will simply execute the callback as part of another transaction,
- if the function has to retrieve a new database connection, it takes responsibility to either `commit` the changes performed by the callback or to `rollback` them, if any exception was raised.

TODO: similar changes could apply to `trac.ticket.model`

2008-07-08 12:48:18 Tree
[r7332] by cboos

Recreate WikiRename branch for rebasing log:sandbox/wiki-rename@...

2008-07-08 11:51:07 Tree
[r7331] by cboos

0.12dev: merged revisions r7320 and r7327 from 0.11-stable (r7325 was already merged), via svnmerge.

2008-07-08 11:49:02 Tree
[r7330] by cboos

Rebase WikiRename branch

2008-07-08 11:44:00 Tree
[r7329] by cboos

Retiring old [VcRefactoring/Controller] branch

2008-07-08 10:54:59 Tree
[r7328] by cboos

Retiring old TracCrossReferences branch

2008-07-08 10:52:53 Tree
[r7327] by cboos

Replace an user visible assert by a more explicit !TracError (closes #6999)

2008-07-08 08:36:39 Tree
[r7326] by mgood

merge r7325 to trunk (make scripts generated by "deploy" command use sys.executable instead of hardcoding `/usr/bin/python` so that they work in virtualenv or other setups)

2008-07-07 06:09:22 Tree
Older >
MongoDB Logo MongoDB