TIM wrote:
> Hi,
> I post this question to the Trac User group (http://groups.google.com/
> group/trac-users/browse_thread/thread/e11b28abae4ff79/
> e97b512e58893e97#e97b512e58893e97), but nobody response to me.
>
> I have svn repository under my trac and in this repository I have a
> many folders with @ (at-sign) prefix. This is very obviously if you
> are programming Matlab objects. Is there any way how to use TracLinks
> to files in these folders?
> For example I need link to this file (without file revision):
> source:/trunk/scheduling/@graph/complete.m
>
Here's a simple patch. It checks for the rev argument (@something), and
asks the repository if it is valid. If not (exception thrown) and rev
contains @, then rev is split.
Devs, see any issues with this approach?
--- C:/TracDev/trac/trac/versioncontrol/web_ui/browser.py Wed Apr
30 16:50:43 2008
+++ c:/Python25/lib/site-packages/trac/versioncontrol/web_ui/browser.py
Tue Sep 02 09:59:36 2008
@@ -607,6 +607,14 @@
match = self.PATH_LINK_RE.match(path)
if match:
path, rev, marks = match.groups()
+ if rev:
+ repos = self.env.get_repository()
+ try:
+ repos.normalize_rev(rev)
+ except: # Should probably catch the specific exception
here
+ if rev.find('@') != -1:
+ path += '@' + rev.split('@')[0]
+ rev = rev.split('@')[1:]
return tag.a(label, class_='source',
href=(formatter.href.browser(path, rev=rev,
marks=marks) +
query + fragment))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---