Edgewall Software
Modify

Opened 7 years ago

Closed 5 years ago

Last modified 4 years ago

#10386 closed defect (fixed)

Cannot annotate/blame a file with filename containing %25 (/) escapes

Reported by: al.willmer@… Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: version control/browser Version: 0.12-stable
Severity: minor Keywords: svn blame
Cc: Jun Omae
Release Notes:

Fix subversion blame not working for path contained urlencoded characters, e.g. %25, %2F.

API Changes:

Description

If a file named abc%25def is stored under version control then Trac is unable to annotate that file. The url linked form the file browser is http://localhost:8000/trac-env/browser/abc%25def. The file can be viewed, but if blame is attempted by visiting http://localhost:8000/trac-env/browser/abc%25def?annotate=blame the error

Warning: Can't use blame annotator:
svn blame failed on DefineGuide%2FDefineWiki: ("'/svn-repo/abc/def' is not a file in revision 1", 160017)

The contents of the file are displayed, but the rev column is blank.

OS: Ubuntu 10.04 x86 Python: 2.6.5 Database: Sqlite 3.6.22 VCS: Subversion 1.6.6 Trac: 0.12.3dev-r10806

Attachments (0)

Change History (13)

comment:1 Changed 6 years ago by Christian Boos

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 Changed 5 years ago by Ryan J Ollos

Milestone: undecided1.0.2
Owner: set to Ryan J Ollos
Status: newassigned

comment:3 Changed 5 years ago by Jun Omae

I think we should fix the issue in 0.12-stable.

comment:4 Changed 5 years ago by Ryan J Ollos

Milestone: 1.0.20.12.6

comment:5 Changed 5 years ago by Jun Omae

Proposed changes in jomae.git@t10386_0.12 and jomae.git@t10386.

Verified with the following environments.

  • Linux: Subversion 1.7.6 on Python 2.4 - 2.7
  • Linux: Subversion 1.6.11 on Python 2.4 - 2.7
  • Windows: Subversion 1.7.13 on Python 2.6
Last edited 5 years ago by Jun Omae (previous) (diff)

comment:6 Changed 5 years ago by Ryan J Ollos

Looks good. On Ubuntu 13.04 I can reproduce the issue with a filename containing %2F, but not %25.

Tested with SVN 1.8.8 and Python 2.7 on Linux. Someday I'll get the SVN bindings installed correctly for Python 2.5 and 2.6 so that I can test with those version.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:7 in reply to:  6 Changed 5 years ago by Jun Omae

Keywords: jomae added

Replying to rjollos:

Looks good. On Ubuntu 13.04 I can reproduce the issue with a filename containing %2F, but not %25.

Does that mean %25 cannot lead this issue? I consider that all % with 2 hex-characters, e.g. %30, %00, should lead.

C:> svnadmin create C:\usr\var\svn\t10386
C:> svnadmin load C:\usr\var\svn\t10386 < tracopt\versioncontrol\svn\tests\svnrepos.dump
...
C:> C:\usr\src\trac\venv\svn18-py27\Scripts\python.exe
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from svn import core
>>> core.SVN_VERSION
'1.8.8 (r1568071)'
>>> from trac.env import Environment
>>> env = Environment(r'C:\usr\var\trac\1.0')
>>> repos = env.get_repository('t10386')
>>> node = repos.get_node('branches/t10386/READ%25ME.txt')
>>> node.get_annotations()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tracopt\versioncontrol\svn\svn_fs.py", line 848, in get_annotations
    path=self.path, error=to_unicode(e)))
trac.core.TracError: svn blame failed on branches/t10386/READ%25ME.txt: 150000 - 'file:///C:/usr/var/svn/t10386/branches/t10386/READ%25ME.txt' does not exist in revision 29

Verified that unit tests pass with Subversion 1.8.8 on Python 2.6 for Windows.

comment:8 Changed 5 years ago by Jun Omae

Cc: Jun Omae added
Keywords: jomae removed

comment:9 Changed 5 years ago by Ryan J Ollos

Owner: Ryan J Ollos deleted
Status: assignednew

comment:10 Changed 5 years ago by Jun Omae

Owner: set to Jun Omae
Status: newassigned

I'll push the changes after verifying with repository directory included unicode characters on both Linux and Windows.

comment:11 Changed 5 years ago by Jun Omae

Keywords: svn added
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [12817] and merged to 1.0-stable in [12818] and to trunk in [12819].

comment:12 Changed 4 years ago by Ryan J Ollos

Component: version controlversion control/browser

comment:13 Changed 4 years ago by Ryan J Ollos

Keywords: blame added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
to The owner will be changed from Jun Omae 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.