Edgewall Software

Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#10390 closed defect

Subversion assertion with leading double slashes in repository path — at Version 6

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: Branch:
Release Notes:

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

API Changes:
Internal 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

Change History (6)

comment:1 by Jun Omae, 13 years ago

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 by Christian Boos, 13 years ago

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

comment:3 by Jun Omae, 11 years ago

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 by Christian Boos, 11 years ago

Verified on Linux x86_64 with Python 2.7.3 and Subversion 1.7.8.

comment:5 by Jun Omae, 11 years ago

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 by Jun Omae, 11 years ago

Release Notes: modified (diff)
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.