Opened 13 years ago
Last modified 15 months ago
#10480 new defect
forward slash in repository name causes errors
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | next-stable-1.6.x |
Component: | version control/browser | Version: | 0.12dev |
Severity: | minor | Keywords: | repository browser |
Cc: | Ryan J Ollos | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When adding a repository to my new Trac 0.12 installation, I made the mistake of using the URL as the repository name. It turns out that Trac does not like forward slashes in the repository name.
Here's the command I used:
[root@svn-server:/var/lib/trac/projects/trac-env]# trac-admin $PWD repository add "svn://svn-server" /path/to/svn/repos/ svn
Here's the error that is displayed when I try to browse the source:
Here's the warning out of the log. Note that it only diplays one out of the two forward slashes.
2011-11-22 12:17:13,017 Trac[env] INFO: -------------------------------- environment startup [Trac 0.12.2] -------------------------------- 2011-11-22 12:17:13,160 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect 2011-11-22 12:17:13,188 Trac[api] INFO: Synchronized '' repository in 0.02 seconds 2011-11-22 12:17:13,191 Trac[main] WARNING: HTTPNotFound: 404 Trac Error (No node svn:/svn-server)
When I use the "(default)" name for the same repository instead of the name with forward slashes, everything works fine.
Attachments (1)
Change History (11)
by , 13 years ago
Attachment: | trac_browse_source_error.png added |
---|
comment:1 by , 13 years ago
Milestone: | → next-minor-0.12.x |
---|
At some point, we wanted to allow slashes in repository names to create some kind of virtual repository hierarchy, i.e. if you defined repositories named projects/proj1 and projects/proj2, you would see a virtual folder "projects", and you would find "proj1" and "proj2" in it.
Until this is implemented, I would suggest we simply disallow the use of forward slashes in repository names.
follow-up: 4 comment:2 by , 11 years ago
Cc: | added |
---|
Another effect is that a repository name containing a forward slash, such as proj/one
, can't be edited from the repository admin page. When clicking on the link to navigate to the detail page an error message is displayed: Repository 'proj/one' not found, and the href is /admin/versioncontrol/repository/proj/one
.
comment:3 by , 11 years ago
Milestone: | next-minor-0.12.x → next-stable-1.0.x |
---|---|
Owner: | set to |
Status: | new → assigned |
follow-up: 5 comment:4 by , 11 years ago
Replying to rjollos:
Another effect is that a repository name containing a forward slash, such as
proj/one
, can't be edited from the repository admin page. When clicking on the link to navigate to the detail page an error message is displayed: Repository 'proj/one' not found, and the href is/admin/versioncontrol/repository/proj/one
.
I cannot reproduce it. Works for me with tracd
of 1.0-stable and 0.12-stable.
Also, the original issue maybe is caused by mod_wsgi that collapses double slashes, #10048.
follow-up: 6 comment:5 by , 11 years ago
Replying to jomae:
I cannot reproduce it. Works for me with
tracd
of 1.0-stable and 0.12-stable.Also, the original issue maybe is caused by mod_wsgi that collapses double slashes, #10048.
I may have provided the incorrect parameters to reproduce. I can reproduce with name /proj/one
and path /var/www/svn/proj/one
. I'm not sure the leading slash is needed to reproduce the error in every circumstance; I'm still working on narrowing in on the exact parameters needed to reproduce.
comment:6 by , 11 years ago
Replying to rjollos:
Replying to jomae:
I cannot reproduce it. Works for me with
tracd
of 1.0-stable and 0.12-stable.I may have provided the incorrect parameters to reproduce. I can reproduce with name
/proj/one
and path/var/www/svn/proj/one
. I'm not sure the leading slash is needed to reproduce the error in every circumstance; I'm still working on narrowing in on the exact parameters needed to reproduce.
Reproduced, thanks. The issue has been reported in #7617.
trac.web.href:Href
class strips leading and trailing slash characters.
>>> from trac.web.href import Href >>> href = Href('http://localhost') >>> href() 'http://localhost' >>> href.admin('versioncontrol', 'repository') 'http://localhost/admin/versioncontrol/repository' >>> href.admin('versioncontrol', 'repository', 'proj/one') 'http://localhost/admin/versioncontrol/repository/proj/one' >>> href.admin('versioncontrol', 'repository', '///proj/one') 'http://localhost/admin/versioncontrol/repository/proj/one' >>> href.admin('versioncontrol', 'repository', 'proj/one///') 'http://localhost/admin/versioncontrol/repository/proj/one'
comment:7 by , 10 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:8 by , 8 years ago
Milestone: | next-stable-1.0.x → next-stable-1.2.x |
---|
Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.
comment:9 by , 5 years ago
Milestone: | next-stable-1.2.x → next-stable-1.4.x |
---|
screenshot of error