Edgewall Software

Ticket #7810 (closed defect: fixed)

Opened 2 months ago

Last modified 6 weeks ago

[svn:externals] directive is not being parsed correctly

Reported by: marijn Owned by: cboos
Priority: normal Milestone: 0.11.3
Component: version control/browser Version: 0.11.1
Severity: minor Keywords: svn:externals
Cc:

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

Change History

Changed 2 months ago by cboos

  • owner set to cboos
  • status changed from new to assigned
  • milestone set to 0.11.3

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: 

Changed 2 months ago by anonymous

  • status changed from assigned to closed
  • resolution set to worksforme

Thanks for the patch. this works for me.

Changed 2 months ago by ebray

  • status changed from closed to reopened
  • resolution worksforme deleted

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

Changed 2 months ago by cboos

The fix will be applied after the 0.11.2.1 release.

Changed 6 weeks ago by cboos

  • status changed from reopened to closed
  • resolution set to fixed
  • severity changed from normal to minor

Patch applied in r7723.

Add/Change #7810 ([svn:externals] directive is not being parsed correctly)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cboos. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.