Guest?
 
Project
SVNKit
Priority
Normal
Type
Bug
State
Submitted
Assignee
Alexander Kitaev
Subsystem
Unknown subsystem
Affected versions
1.7.5-v1
Fix versions
No Fix versions
Fixed in build
No Fixed in build
  • Created by   Radai Rosenblatt
    9 months ago (07 Aug 2012 18:06)
  • Updated by   Dmitry Pavlenko
    9 months ago (08 Aug 2012 19:53)
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
running somewhere inside an SVN working copy, this should work, but doesnt:

File currentDirectory = new File(".");
File wcRoot = SVNWCUtil.getWorkingCopyRoot(currentDirectory, true);

this, however, does work:
File currentDirectory = new File(".");
File wcRoot = SVNWCUtil.getWorkingCopyRoot(currentDirectory.getCanonicalFile(), true);

the canonical file path doesnt end in "." and im guessing svn (1.7) DB contains only canonical names.
would be nice if SVNWCUtil would canonicalize files, just to be safe :-)
Comments (3)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Dmitry Pavlenko
  Dmitry Pavlenko
08 Aug 2012 13:30
9 months ago
What do you mean by "doesn't work"? For me it resolves "/path/to/that/directory/." not so beautiful, but I can't say it's incorrect.

"getCanonicalFile" follows symlinks, that is shouldn't be done in this method. Consider an example:
You have versioned symlink in one working copy pointing to another working copy. SVNWCUtil.getWorkingCopyRoot(symlink, true) should return the first working copy for that example.
Radai Rosenblatt
  Radai Rosenblatt
08 Aug 2012 19:51
9 months ago
for me the value returned is null for the non-canonical file. i will try to reproduce this again and if i succeed i'll post a zip file with a complete reproduction kit
Dmitry Pavlenko
  Dmitry Pavlenko
08 Aug 2012 19:53
9 months ago
Yes, please. And also please specify OS and slashes kind in the path ('/' or '\') you use.

What about DB: it contains only relative (to the working copy root) paths with direct slashes.
Apply Command

Command Preview: