Edgewall Software
Modify

Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#10390 closed defect (fixed)

Subversion assertion with leading double slashes in repository path

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: version control Version: 0.12.2
Severity: normal Keywords: svn
Cc:
Release Notes:

Fix Subversion assertion while accessing repository which has the path starts with double slash characters.

API Changes:

Description

When syncing a subversion repository that has leading double slashes in the path, the assertion occurs with subversion 1.6.11 and python 2.4.

Trac [/home/jun66j5/var/trac/0.12-stable]> repository add (default) //var/lib/svn/sandbox
Trac [/home/jun66j5/var/trac/0.12-stable]> repository list

Name       Type  Alias  Directory
---------------------------------------------
(default)               //var/lib/svn/sandbox

Trac [/home/jun66j5/var/trac/0.12-stable]> repository sync (default)
python2.4: subversion/libsvn_subr/path.c:114: svn_path_join: Assertion `svn_path_is_canonical(base, pool)' failed.
Aborted

Attachments (0)

Change History (7)

comment:1 Changed 7 years ago by Jun Omae

Keywords: svn added

The same assertion happens with subversion 1.7.1.

Trac [/home/jun66j5/var/trac/0.12-stable]> repository list

Name       Type  Alias  Directory
---------------------------------------------
(default)               //var/lib/svn/sandbox

Trac [/home/jun66j5/var/trac/0.12-stable]> repository sync (default)
python2.4: subversion/libsvn_subr/dirent_uri.c:955: svn_dirent_join: Assertion `svn_dirent_is_canonical(base, pool)' failed.
Aborted

comment:2 Changed 7 years ago by Christian Boos

We would need to extend the Repository API with a normalize_repository_path method.

comment:3 Changed 5 years ago by Jun Omae

SubversionRepository.__init__ normalizes the repository path using os.path.normpath. However, the method keeps the leading double slashes. We can use svn_path_canonicalize to normalize. Also, the issue doesn't occur on Windows.

[2ee9432c/jomae.git].

Python 2.4.3 (#1, Jan  9 2013, 06:49:54)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> from svn import core
>>> repos_path = '//path//to//repos'
>>> os.path.normpath(repos_path).replace('\\', '/')
'//path/to/repos'
>>> core.svn_path_canonicalize(os.path.normpath(repos_path).replace('\\', '/'))
'/path/to/repos'
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> from svn import core
>>> repos_path = r'c:\\path\\to\\repos'
>>> os.path.normpath(repos_path).replace('\\', '/')
'c:/path/to/repos'
>>> core.svn_path_canonicalize(os.path.normpath(repos_path).replace('\\', '/'))
'C:/path/to/repos'

comment:4 Changed 5 years ago by Christian Boos

Verified on Linux x86_64 with Python 2.7.3 and Subversion 1.7.8.

comment:5 Changed 5 years ago by Jun Omae

Milestone: next-minor-0.12.x0.12.6
Owner: set to Jun Omae
Status: newassigned

I've verified on:

  • Linux x86_64 with Python 2.6.6 and Subversion 1.6.11
  • Linux i386 with Python 2.4.3 and Subversion 1.7.6

comment:6 Changed 5 years ago by Jun Omae

Release Notes: modified (diff)
Status: assignedclosed

The [2ee9432c/jomae.git] is applied in [11789]. Thanks again, Christian!

comment:7 Changed 5 years ago by Ryan J Ollos

Resolution: fixed

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.