Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#7810 closed defect (fixed)

[svn:externals] directive is not being parsed correctly

Reported by: marijn Owned by: Christian Boos
Priority: normal Milestone: 0.11.3
Component: version control/browser Version: 0.11.1
Severity: minor Keywords: svn:externals
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /browser, Trac issued an internal error.

I tried to map my svn:external definition to another trac browser with the following directive in trac.ini:

[svn:externals]
1 = http://svn.symfony-project.com http://trac.symfony-project.org/browser/$path?rev=$rev

This results in the error described below. The error only occurs if the repository external definition from trac.ini is found in the repository structure.

Request parameters:

{'path': '/'}

User Agent was: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22

System Information

Trac 0.11.1
Python 2.4.3 (#1, May 24 2008, 13:47:28)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]
setuptools 0.6c9
SQLite 3.3.6
pysqlite 1.1.7
Genshi 0.5.1
mod_python 3.2.8
Subversion 1.4.2 (r22196)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/versioncontrol/web_ui/browser.py", line 359, in process_request
    node.get_properties()),
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/versioncontrol/web_ui/browser.py", line 548, in render_properties
    return filter(None, [self.render_property(name, mode, context, props)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/versioncontrol/web_ui/browser.py", line 560, in render_property
    rendered = renderer.render_property(name, mode, context, props)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/versioncontrol/svn_fs.py", line 315, in render_property
    return self._render_externals(props[name])
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/versioncontrol/svn_fs.py", line 358, in _render_externals
    remotepath = posixpath.join(*reversed(prefix))
TypeError: join() takes at least 1 argument (0 given)

Attachments (0)

Change History (5)

comment:1 by Christian Boos, 16 years ago

Milestone: 0.11.3
Owner: set to Christian Boos
Status: newassigned

I can't test the svn stuff at the moment, but could you please try the following patch?

  • trac/versioncontrol/svn_fs.py

     
    355355                             url.startswith('https://')):
    356356                href = url.replace('%', '%%')
    357357            if href:
    358                 remotepath = posixpath.join(*reversed(prefix))
     358                remotepath = ''
     359                if prefix:
     360                    remotepath = posixpath.join(*reversed(prefix))
    359361                externals.append((localpath, revstr, base_url, remotepath,
    360362                                  href % {'path': remotepath, 'rev': rev}))
    361363            else:

comment:2 by anonymous, 16 years ago

Resolution: worksforme
Status: assignedclosed

Thanks for the patch. this works for me.

comment:3 by ebray, 16 years ago

Resolution: worksforme
Status: closedreopened

Don't close the ticket if the fix hasn't been applied in the repository yet.

comment:4 by Christian Boos, 16 years ago

The fix will be applied after the 0.11.2.1 release.

comment:5 by Christian Boos, 16 years ago

Resolution: fixed
Severity: normalminor
Status: reopenedclosed

Patch applied in r7723.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


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