#10673 closed enhancement (fixed)
Clarify in TracIni documentation how to set downloadable_paths for a multirepository environment
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.0.1 |
Component: | version control/browser | Version: | 0.12.3 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Improved TracIni documentation on how to set |
||
API Changes: | |||
Internal Changes: |
Description
I have a multirepository environment and was attempting to set the downloadlable_path
option in the browser
section. By trial and error, I arrived at the finding that I must prefix the repository name to these paths. It seems like it would be useful to add this to the documentation. Suggested addition in italics:
List of repository paths that can be downloaded. Leave the option empty if you want to disable all downloads, otherwise set it to a comma-separated list of authorized paths (those paths are glob patterns, i.e. "*" can be used as a wild card). In a multi-repository environment, the repository name must be prefixed to the paths (e.g. /repos1/trunk, /repos2/trunk) (since 0.10)
… or is this idea of prefixing the repository name to trac.ini
options more obvious and I've overlooked it elsewhere in the documentation? In retrospect, I shouldn't be so surprised that I have to prefix the repository name, but the exact syntax for the prefixing wasn't obvious to me. At first I tried repos1:/trunk
, before noticing that the path in the repository browser was /repos/trunk
, which made the solution more obvious. It also wasn't obvious to me though that simply specifying /trunk
, wouldn't make /trunk
a downloadable path for the default repository.
Attachments (1)
Change History (9)
follow-up: 2 comment:1 by , 12 years ago
follow-up: 3 comment:2 by , 12 years ago
Replying to Ryan J Ollos <ryano@…>:
Minor refinement to clarify that the repository name only needs to be included in the path if it is not the default repository.
List of repository paths that can be downloaded. Leave the option empty if you want to disable all downloads, otherwise set it to a comma-separated list of authorized paths (those paths are glob patterns, i.e. "*" can be used as a wild card). In a multi-repository environment, the path must be qualified with the repository name if the path does not point to the default repository (e.g. /reposname/trunk) (since 0.10).
Patch please!
In testing this out, I found what might be considered a minor bug. If I have two repositories, repos and repos2, with repos being the default repository, then
[source:/repos/trunk]
and[source:/trunk]
point to the same location in the default repository. However,dowloadable_paths = /repos/trunk
does not result in a download link being added to thetrunk
directory in the default repository. Onlydownloadable_paths = /trunk
works correctly.
Or you can add a warning about this in the docstring as well (much easier than adding the necessary code!):
Note that a simple prefix matching is performed on the paths, so aliases won't get automatically resolved.
comment:3 by , 12 years ago
Replying to cboos:
Or you can add a warning about this in the docstring as well (much easier than adding the necessary code!):
I had spent a bit of time looking at the code for this, and it did look challenging indeed.
t10673-r11111-1.patch implements the proposed documentation changes, including your suggestions re prefix matching.
comment:4 by , 12 years ago
Milestone: | → 1.0.1 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:6 by , 12 years ago
Owner: | changed from | to
---|
comment:7 by , 12 years ago
Owner: | changed from | to
---|
comment:8 by , 12 years ago
Release Notes: | modified (diff) |
---|
Minor refinement to clarify that the repository name only needs to be included in the path if it is not the default repository.
List of repository paths that can be downloaded. Leave the option empty if you want to disable all downloads, otherwise set it to a comma-separated list of authorized paths (those paths are glob patterns, i.e. "*" can be used as a wild card). In a multi-repository environment, the path must be qualified with the repository name if the path does not point to the default repository (e.g. /reposname/trunk) (since 0.10).
In testing this out, I found what might be considered a minor bug. If I have two repositories, repos and repos2, with repos being the default repository, then
[source:/repos/trunk]
and[source:/trunk]
point to the same location in the default repository. However,dowloadable_paths = /repos/trunk
does not result in a download link being added to thetrunk
directory in the default repository. Onlydownloadable_paths = /trunk
works correctly.