Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#7844 closed defect (fixed)

relative repository_dir broken, after update to 0.11 stable

Reported by: ilias@… Owned by: Christian Boos
Priority: normal Milestone: 0.11.3
Component: version control Version: 0.11-stable
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Recreation:

Within an ini-file, set the repository_dir to a trac-environment relative path (e.g. "repository_dir = svn" or "repository_dir = ../svn")

Such environment works with 0.11b1 but breaks with 0.11stable

Error Message:

Can't synchronize with the repository (The 'repository_dir' has changed, a 'trac-admin resync' operation is needed.).

A trac-admin resync operation has no effect

Log from trac-admin resync (trac environment at P:/local, svn at P:/svn, repository_dir = ../svn)

2008-11-28 18:46:16,132 Trac[cache] INFO: Resetting "repository_dir": svn:5c35be4b-fc5d-d041-b843-95677c81c4ed:P:/svn
2008-11-28 18:46:16,223 Trac[cache] DEBUG: cache metadata undefined (youngest_rev=u'')
2008-11-28 18:46:16,223 Trac[cache] INFO: repos rev [0] != cached rev [None]

log from failed check:

2008-11-28 18:47:51,809 Trac[main] DEBUG: Dispatching <Request "GET u'/about'">
2008-11-28 18:47:51,839 Trac[cache] INFO: 'repository_dir' has changed from u'svn:5c35be4b-fc5d-d041-b843-95677c81c4ed:P:/svn' to u'svn:5c35be4b-fc5d-d041-b843-95677c81c4ed:p:/svn'

please notice "P:/svn" and 'p:/svn" (upper case P/ lower case p)

Attachments (0)

Change History (6)

comment:1 by Christian Boos, 15 years ago

Milestone: 0.11.3
Owner: set to Christian Boos

Hm, a normcase is missing somewhere. Thank you for the report.

Could you please try this patch?

  • trac/versioncontrol/svn_fs.py

     
    394394        # Remove any trailing slash or else subversion might abort
    395395        if isinstance(path, unicode):
    396396            path = path.encode('utf-8')
    397         path = os.path.normpath(path).replace('\\', '/')
     397        path = os.path.normpath(os.path.normcase(path)).replace('\\', '/')
    398398        self.path = repos.svn_repos_find_root_path(path, self.pool())
    399399        if self.path is None:
    400400            raise TracError(_("%(path)s does not appear to be a Subversion "

comment:2 by ilias@…, 15 years ago

The patch works, although I have to apply trac-admin resync first (just wondering, but that's ok for me).

comment:3 by Christian Boos, 15 years ago

Somehow the trac server side has a notion of current working directory being c:/… (lower case) and trac-admin had another (C:/… upper case). As this is something that can happen with case insensitive file systems, better normalize it.

But now I just realized that doing it that way will have the unfortunate side-effect of requiring a resync when the previously stored path was C:/… (and that should actually be the most common situation).

So we should rather do a case-insensitive comparison instead of (or in addition to) the previous normalization.

comment:4 by ilias@…, 15 years ago

ok, I understand.

I'll test again if you provide a better patch (I can't think myself, as I am totally out of code).

comment:5 by Christian Boos, 15 years ago

Milestone: 0.11.40.11.3

comment:6 by Christian Boos, 15 years ago

Resolution: fixed
Status: newclosed

"normcase"d check done in r7836.

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.