开发者

How to read a log from a SVN path with spaces with SharpSVN?

I have a path in a repo with spaces like this:

https://mysvnserver.local/svn/branches/2.7 Feature XYZ

Now I want to read the log from this path using SharpSvn.

I have this code:

var client = new SvnClient();
client.Authentication.DefaultCredentials = new NetworkCredential(userName, password);

var logArguments = new SvnLogArgs(new SvnRevisionRange(startRevision, endRevision)) { RetrieveMergedRevisions = true };

var uri = new Uri(repoUrl);
Console.WriteLine("Absolute Uri: " + uri.AbsoluteUri);

Collection<SvnLogEventArgs> list;
client.GetLog(uri, logArguments, out list);

Absolute Uri displays:

https://mysvnserver.local/svn/branches/2.7%20Feature%20XYZ

which (for my understanding) is completely correc开发者_StackOverflowt escaped for usage in the URI, but I then get an

SvnFileSystemException - File not found: revision 1612, path ´/branches/2.7_Feature_XYZ´

when the client.GetLog() is called. Telling from the error message, SharpSvn is replacing the spaces with underscores internally.

How can I prevent this and read the log messages from this path?

Edit Update: Until now I tried to replace the space with \, %20 and +. With no effects. The path can't be found. I also tried to pass the URI both with and without the trailing slash for all replacments above - also no effect.


You should replace "%20" with "\ "

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜