Opened 10 years ago
Closed 10 years ago
#12313 closed defect (fixed)
trac.versioncontrol.admin.RepositoryAdminPanel depends on trac.versioncontrol.web_ui.main.VersionControlUI
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.10 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Fixed Version Control: Repositories admin template not available if |
||
| API Changes: | |||
| Internal Changes: | |||
Description
When using trac-github integration the components trac.versioncontrol.web_ui.* are disabled. With trac.versioncontrol.web_ui.* = disabled the repository admin panel (trac.versioncontrol.admin.RepositoryAdminPanel) shows an error because the template is not available.
The problem is that admin_repositories.html template will only be available if trac.versioncontrol.web_ui.main is enabled. The following configuration will work, but it's not very obvious to the user:
trac.versioncontrol.web_ui.* = disabled trac.versioncontrol.web_ui.main.* = enabled
Maybe there's a better solution than having a dedicated Component for implementing ITemplateProvider: tags/trac-1.0.9/trac/versioncontrol/web_ui/main.py.
I propose to move the ITemplateProvider implementation to RepositoryManager.
Attachments (0)
Change History (9)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
In this case the issue might not occur if we separated the Interfaces from the Environment class, by having them in separate modules. I haven't tested out that idea though.
comment:3 by , 10 years ago
follow-up: 5 comment:4 by , 10 years ago
follow-up: 6 comment:5 by , 10 years ago
Replying to Ryan J Ollos:
#5010 looks interesting. Should we go ahead and implement the fix in this ticket with the thought that at least one of the local imports will be removed when #5010 is implemented?
Fine by me, and the other local import is in a backward compat method that we could deprecate.
follow-up: 8 comment:6 by , 10 years ago
Replying to Christian Boos:
Fine by me, and the other local import is in a backward compat method that we could deprecate.
Yeah, I would like the remove get_repository in 1.3.1 (#11901). I'll plan to mark it as deprecated if no one else objects. We previously touched on this in comment:32:ticket:11605.
comment:7 by , 10 years ago
| Owner: | set to |
|---|---|
| Release Notes: | modified (diff) |
| Status: | new → assigned |
comment:8 by , 10 years ago
Replying to Ryan J Ollos:
Yeah, I would like the remove
get_repositoryin 1.3.1 (#11901). I'll plan to mark it as deprecated if no one else objects. We previously touched on this in comment:32:ticket:11605.
Added notice in [14435].
comment:9 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |



There is a circular import in initial changes:
Traceback (most recent call last): File "./trac/test.py", line 33, in <module> import trac.db.mysql_backend File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/db/mysql_backend.py", line 29, in <module> from trac.env import IEnvironmentSetupParticipant File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/env.py", line 42, in <module> from trac.versioncontrol.api import RepositoryManager File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/versioncontrol/__init__.py", line 14, in <module> from trac.versioncontrol.api import * File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/versioncontrol/api.py", line 30, in <module> from trac.web.chrome import ITemplateProvider File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/web/chrome.py", line 48, in <module> from trac.env import IEnvironmentSetupParticipant, ISystemInfoProvider ImportError: cannot import name IEnvironmentSetupParticipant make: *** [unit-test] Error 1Let me know if you see a cleaner way to resolve the issue than proposed changes in log:rjollos.git:t12313_versioncontrol_itemplateprovider.