Modify ↓
Opened 14 years ago
Last modified 10 years ago
#10079 new defect
improper rendering of svn:externals when not configured
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | version control/browser | Version: | |
Severity: | normal | Keywords: | svn:externals |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Some people do not (or can not) configure all of their svn:external properties to really point to some http:// url. So when trac.ini has no svn:externals section the entry
foo svn://svnserver/path/to/whatever
will be just rendered as
- foo
and nothing else. This is pretty annoying, and I have modified my trac to display in that case the complete line from the externals entry, so if you are intrested, here is my _render_externals
function (modified against 0.12.2)
-
trac/versioncontrol/svn_prop.py
diff --git a/trac/versioncontrol/svn_prop.py b/trac/versioncontrol/svn_prop.py index 8c77d0c..2b3e906 100644
a b class SubversionPropertyRenderer(Component): 71 71 continue 72 72 localpath, rev, url = elements[0], '', elements[-1] 73 73 if localpath.startswith('#'): 74 externals.append((external, None, None, None, None ))74 externals.append((external, None, None, None, None, None)) 75 75 continue 76 76 if len(elements) == 3: 77 77 rev = elements[1] … … class SubversionPropertyRenderer(Component): 94 94 if prefix: 95 95 remotepath = posixpath.join(*reversed(prefix)) 96 96 externals.append((localpath, revstr, base_url, remotepath, 97 href % {'path': remotepath, 'rev': rev})) 97 href % {'path': remotepath, 'rev': rev}, 98 external)) 98 99 else: 99 externals.append((localpath, revstr, url, None, None)) 100 externals.append((localpath, revstr, url, None, None, 101 external)) 100 102 externals_data = [] 101 for localpath, rev, url, remotepath, href in externals:103 for localpath, rev, url, remotepath, href, external in externals: 102 104 label = localpath 103 105 if url is None: 104 106 title = '' … … class SubversionPropertyRenderer(Component): 108 110 label += rev + url 109 111 title = ''.join((remotepath, rev, url)) 110 112 else: 113 label = external 111 114 title = _('No svn:externals configured in trac.ini') 112 115 externals_data.append((label, href, title)) 113 116 return tag.ul([tag.li(tag.a(label, href=href, title=title))
Attachments (0)
Change History (3)
comment:1 by , 12 years ago
Milestone: | → undecided |
---|
comment:2 by , 11 years ago
Component: | general → version control/browser |
---|---|
Keywords: | svn:externals added |
comment:3 by , 10 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.
All the tickets for {20} from last year have probably been seen multiple times by now, yet are still to be triaged…