1
我有一個回購與空間這樣的路徑:如何從帶有SharpSVN空格的SVN路徑讀取日誌?
https://mysvnserver.local/svn/branches/2.7 Feature XYZ
現在我想讀的使用SharpSvn這條道路的日誌。
我有這樣的代碼:
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);
絕對URI顯示:
https://mysvnserver.local/svn/branches/2.7%20Feature%20XYZ
它(我的理解)是完全正確的轉義在URI中使用,但後來我得到一個
SvnFileSystemException - File not found: revision 1612, path ´/branches/2.7_Feature_XYZ´
當調用client.GetLog()
時。從錯誤消息中得知,SharpSvn在內部用下劃線替換空格。
我該如何防止並從此路徑讀取日誌消息?
編輯更新: 直到現在我試圖用\
,%20
和+
替換空間。沒有效果。路徑找不到。我也嘗試傳遞上面所有替換的帶有和不帶尾隨斜槓的URI - 也沒有效果。
這是不可能取代
"%20"
。 'Uri'類自動爲空格使用'%20'。 –