Ticket #6665 (closed enhancement: worksforme)
Opened 4 years ago
Last modified 2 years ago
Display external definitions as links
| Reported by: | christian_unger@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | version control/browser | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
Trac will display external definitions as plain text, although the displayed text contains URLs to the referenced externals.
It'd be a great help if those link were shown as html links, so one click will bring the user to the displayed directory.
Attachments
Change History
comment:1 follow-up: ↓ 8 Changed 4 years ago by cboos
- Resolution set to worksforme
- Status changed from new to closed
comment:2 Changed 3 years ago by roger@…
I have the same question as the original poster. trac is finding the item, accessing the repository using http, and the URL is the one I would use to access the repository.
In my case, the svn:external is a different repository on the same local server. So I am unclear on the syntax of referring to this. What would I need to map the http: URL into to get the external repository to be shown in the nice way trac shows things instead of as plain text (what the svn server provides over http)? I read the trac.ini docs for this as being something that translates one request into another request. I tried something like this:
http://sto-opq-src.scc.se/svn/RSofT_Library http://source/rsoft/browser/$path?rev=$rev
where the first entry is the external repository, and the second is what I am guessing would be where I want it it be to get rendered better. My trac is at http://source/rsoft
In my browser, when I hold the mouse over the link to the external, trac has it as http://sto-opq-src.scc.se/svn/RSofT_Library, no matter if I have an entry in trac.ini. I restart my http server and refresh the page when I change trac.ini.
What am I missing?
TIA
comment:3 Changed 3 years ago by cboos
You probably missed the key = ... part in the setting.
Try something like this:
[svn:externals] lib = http://sto-opq-src.scc.se/svn/RSofT_Library http://source/rsoft/browser/$path?rev=$rev # <key> = <svn:external> <correspond-path-trac> # # Note that the actual value (here 'lib') doesn't matter, it's just # needed to comply to the syntax of the .ini file. #
Note that the above assumes that http://source/rsoft is actually a Trac for which the [trac] repository_dir is set to the repository corresponding to http://sto-opq-src.scc.se/svn/RSofT_Library. If you don't have yet such a Trac, just set up one, or if you feel adventurous, you can try to upgrade to the MultipleRepositorySupport version.
comment:4 Changed 3 years ago by roger@…
Oops. I added the missing 'lib =', but as the external is not set up in a trac, this of course failed.
This is a new trac that I am setting up. So, I think I will try 0.12 with MultipleRepositorySupport. I do not need to keep anything from the current install as it has not been used yet.
Thanks for the help.
One thing I am curious about. It is surely in the docs, but I did not see it. How much does trac cache for an svn repository? Does it effectively check out a copy? Or is it more tricky? I realize this is a different thread...
comment:5 Changed 3 years ago by cboos
Trac caches all the changeset related information in its database, but no property, file or directory content is cached. There's no checkout, all the information is retrieved when needed from the svn repository using the svn API.
The MultipleRepositorySupport doesn't (yet) have any cache support, but that's OK for small or medium-sized svn repositories (i.e. with less than 10k changesets, you should be fine).
comment:6 Changed 3 years ago by anonymous
I installed the new version without complaint. It still says version Trac 0.11.1 at the bottom. Still, I can get multiple repositories in the browser. Yeah.
A few comments / questions (which you probably already know):
- How can I get the name in the Repository Index to keep the case in the name? It is converted to lower case.
- Since you use the init tag as the name to show in the Repository Index, it seems I cannot have a period in the name of the repository as shown.
- I get a default in the Repository Index, as well as that same repository listed in the previous single repository manner. I think that when the multiple repositories are listed, and one of them is the same as the trac repository_dir, it does not need to be listed twice or three times.
Other than that, so far this is going to meet my needs quite nicely. Thanks!
comment:7 Changed 3 years ago by cboos
Thanks for the feedback, I've answered in the branch page directly.
comment:8 in reply to: ↑ 1 Changed 2 years ago by anonymous
Replying to cboos:
By external you mean svn:externals I presume?
This is supported in 0.11, see TracIni#svn:externals-section.
From the documentation, I'm having a little bit of trouble determining when Trac can interpret svn:externals.
The TracBrowser for Subversion can interpret the svn:externals property
of folders out of the box. However, if those externals are not using the
http: protocol, or if a link to a different repository browser (such
another Trac or ViewVC) is desired, then Trac needs to be able to map an
external prefix to this other URL.
Should I also assume that HTTP does not imply HTTPS?
I'm having some trouble getting this to work.



By external you mean svn:externals I presume?
This is supported in 0.11, see TracIni#svn:externals-section.