Edgewall Software

Opened 11 years ago

Last modified 7 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 Jun Omae)

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):  
    7171                continue
    7272            localpath, rev, url = elements[0], '', elements[-1]
    7373            if localpath.startswith('#'):
    74                 externals.append((external, None, None, None, None))
     74                externals.append((external, None, None, None, None, None))
    7575                continue
    7676            if len(elements) == 3:
    7777                rev = elements[1]
    class SubversionPropertyRenderer(Component):  
    9494                if prefix:
    9595                    remotepath = posixpath.join(*reversed(prefix))
    9696                externals.append((localpath, revstr, base_url, remotepath,
    97                                   href % {'path': remotepath, 'rev': rev}))
     97                                  href % {'path': remotepath, 'rev': rev},
     98                                  external))
    9899            else:
    99                 externals.append((localpath, revstr, url, None, None))
     100                externals.append((localpath, revstr, url, None, None,
     101                                  external))
    100102        externals_data = []
    101         for localpath, rev, url, remotepath, href in externals:
     103        for localpath, rev, url, remotepath, href, external in externals:
    102104            label = localpath
    103105            if url is None:
    104106                title = ''
    class SubversionPropertyRenderer(Component):  
    108110                label += rev + url
    109111                title = ''.join((remotepath, rev, url))
    110112            else:
     113                label = external
    111114                title = _('No svn:externals configured in trac.ini')
    112115            externals_data.append((label, href, title))
    113116        return tag.ul([tag.li(tag.a(label, href=href, title=title))

Attachments (0)

Change History (3)

comment:1 by Christian Boos, 9 years ago

Milestone: undecided

All the tickets for {20} from last year have probably been seen multiple times by now, yet are still to be triaged…

comment:2 by Jun Omae, 8 years ago

Component: generalversion control/browser
Keywords: svn:externals added

comment:3 by Jun Omae, 7 years ago

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.