Opened 16 years ago
Last modified 4 years ago
#9208 new defect
Support for SVN repository on a UNC path on Windows
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | normal | Milestone: | unscheduled | 
| Component: | version control | Version: | 0.11 | 
| Severity: | normal | Keywords: | svn patch needfixup | 
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
While setting up a Trac installation a year ago, I ran into a problem where my SVN repository was stored on a UNC accessible path on a Windows-based Apache system. In other words, I was running Trac on Apache for Windows, with the python module for Apache. Our SVN repository was stored on a separate network drive and only accessible via a UNC path.
At the time I was using Trac 0.11.x (not sure of the revision, and I no longer operate that system).
The problem is due to SubversionRepository __init__ not handling the UNC slashes properly. When the path is fixed by converting the '\'\' to '\' the UNC slashes were being transformed to just '\' instead of staying '\'\'. I corrected this by adding splitunc() call before the replace and only performing the replace on the non-UNC portion of the path.
I've attached a diff patch making the similar change to the latest version from the 0.12 trunk, as well as the original modified version from my 0.11 installation.
Attachments (3)
Change History (9)
by , 16 years ago
| Attachment: | svn_fs.py.011 added | 
|---|
by , 16 years ago
| Attachment: | svn_fs.py.012.rev9444 added | 
|---|
Patched version from 0.12 source, rev 9444
comment:1 by , 16 years ago
| Milestone: | → next-minor-0.12.x | 
|---|
Interesting!
But please have a look at TracDev/SubmittingPatches, we prefer to get submissions as patches instead of whole files, as this makes it much easier to see the changes from the ticket and comment on it.
One thing I can already comment on: splitunc is not available on Unix, so you should either make the code platform dependent (if os.name == 'nt':) or add a trac.util.compat.splitunc utility function that encapsulate this.
comment:2 by , 15 years ago
| Keywords: | needfixup added | 
|---|
comment:3 by , 15 years ago
| Milestone: | next-minor-0.12.x → unscheduled | 
|---|
No fixup in one year, unscheduling.
If someone is interested by the feature, please provide a patch as suggested above.
by , 10 years ago
| Attachment: | t9208.diff added | 
|---|
comment:4 by , 10 years ago
Revised patch: t9208.diff for 1.0-stable.
I get weird behavior of trac-admin. The 2 backslash character in UNC path is converted to 3 backslash characters. Even though the behavior, the patch works well for UNC path in repository browser, file view and blame view.
Trac [C:\usr\var\trac\1.0]> repository add unc \\machine\share\path\to\repos svn Trac [C:\usr\var\trac\1.0]> repository list Name Type Alias Directory --------------------------------------------------------- unc svn \\\machine\share\path\to\repos
C:> sqlite3 C:\usr\var\trac\1.0\db\trac.db SQLite version 3.7.15.2 2013-01-09 11:53:05 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> select * from repository where name='dir' and value like '%machine%'; 4|dir|\\\machine\share\path\to\repos
comment:5 by , 10 years ago
| Description: | modified (diff) | 
|---|
comment:6 by , 4 years ago
Just stubled on this error with trac 1.4.2, I need to change a repository path due to server migration.
No Idea how i got it correctly as \\server\dir the last time,
now if I run
repository set myrepo \\server2\dirto switch it to \\server2\dir I get \\\server2\dir



  
Patched version from 0.11 source