开发者

SharpSvn: cannot get information about SVN working copy on network share

开发者 https://www.devze.com 2023-02-15 20:29 出处:网络
I\'m trying to get repository URL of working copy of SVN repository, which is located on network sh开发者_开发知识库are: \\\\host\\D\\directory\\

I'm trying to get repository URL of working copy of SVN repository, which is located on network sh开发者_开发知识库are: \\host\D\directory\

Following code is being executed:

SvnClient svnClient = new SharpSvn.SvnClient();
SvnInfoEventArgs svnInfo;
svnClient.GetInfo(SvnTarget.FromString("\\\\host\\D\\directory\\"), out svnInfo);
Uri repositoryUrl = svnInfo.Uri;

And I got this error on GetInfo() method:

'\host\D' does not exist
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: SharpSvn.SvnException: '\host\D' does not exist

Stack Trace:

[SvnException: '\host\D' does not exist]

[SvnInvalidNodeKindException: '\host\D' is not a working copy]
   SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, SvnException error) +232
   SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, svn_error_t* error) +80
   SharpSvn.SvnClient.Info(SvnTarget target, SvnInfoArgs args, EventHandler`1 infoHandler) +443
   SharpSvn.SvnClient.GetInfo(SvnTarget target, SvnInfoEventArgs& info) +117

Do you know when error lies or maybe you know some better method to use with SharpSvn?


The cause of this 'not a working copy' exception may be that the setting of your svn client is using _svn instead of .svn directories.

Check that you are using the right extension under your svn client settings.


Subversion 1.6 automatically normalized \path\subpath\ to \path\subpath in some of its code paths. This made it impossible to use working copies on UNC paths and/or in the root of a drive.

In Subversion 1.7 these issues were resolved and both scenarios are now fully supported. (But for performance reasons we still recommend using working copies on a local harddisk)


This is an SVN specific exception (SvnInvalidNodeKindException), not a Tortoise exception. But if you install Tortoise, or use SharpSVN library for .NET to integrate with SVN, you may get this.

The problem is that the path in which you are committing is too long in length. There are two odd behaviors. If your local working copy has a Windows length that is too long, SVN will check out an invalid file (not sure about always) but you won't get an exception. The other behavior you'll see is that if you try to replace the file by doing a commit, SVN will throw this exception (SvnInvalidNodeKindException) and will say ['\\folder\\folder\\' is not a working copy and won't commit anything.

Solution:

Shorten the path to something shorter. I don't know what the max is, but I imagine it's the same max length on a file path based on the Windows API. Microsoft never fixed this, and is still an issue today. I posted about this issue in Windows a long time ago, but can't find the post.

0

精彩评论

暂无评论...
验证码 换一张
取 消