C# Sharp SVN更新因文件不存在而崩溃
目前,我正在尝试从svn的嵌入式使用切换到sharp svn插件。我正在使用的程序确实工作了,并且做了它应该做的事情,但是由于我尝试使用sharp svn,它在更新步骤中崩溃了 代码确实使用svn命令运行: svn更新本地路径 我已经找到了很多代码,但这些都不适用于我,下面是目前的代码:C# Sharp SVN更新因文件不存在而崩溃,c#,sharpsvn,C#,Sharpsvn,目前,我正在尝试从svn的嵌入式使用切换到sharp svn插件。我正在使用的程序确实工作了,并且做了它应该做的事情,但是由于我尝试使用sharp svn,它在更新步骤中崩溃了 代码确实使用svn命令运行: svn更新本地路径 我已经找到了很多代码,但这些都不适用于我,下面是目前的代码: using (SvnClient client = new SvnClient()) { //Reporter crea
using (SvnClient client = new SvnClient())
{
//Reporter creates standard svn output
StringBuilder strBuilder = new StringBuilder();
SvnClientReporter reporter = new SvnClientReporter(client, strBuilder);
SvnUpdateArgs asdf = new SvnUpdateArgs();
asdf.AllowObstructions = true;
asdf.Depth = SvnDepth.Infinity;
asdf.IgnoreExternals = true;
asdf.UpdateParents = true;
asdf.Revision = SvnRevision.Head;
asdf.ThrowOnError = false;
asdf.Conflict += new EventHandler<SvnConflictEventArgs>(asdf_Conflict);
asdf.SvnError += new EventHandler<SvnErrorEventArgs>(asdf_Error);
asdf.Notify += new EventHandler<SvnNotifyEventArgs>(asdf_Notify);
asdf.Progress += new EventHandler<SvnProgressEventArgs>(asdf_Progress);
client.Update(localRepoPath, asdf);
_logger.Info("Updated");
_logger.Info(strBuilder.ToString());
}
日志输出为:
未处理的异常:SharpSvn.SvnSystemException:无法打开“D:\workspace\MyRepository\trunk\.svn\tmp\svn-E2A597E3”:系统找不到指定的路径
但是此文件“svn-E2A597E3”不存在,为什么要尝试更新此文件?尝试更新此文件后失败,更新不会尝试更新存储库的其余部分
我如何处理它不尝试更新此文件或不停止更新的情况?它现在可以工作了
我想更新的目录是一个zip文件,它在前面用SharpZipLib解压过。不幸的是,我提取这个Zip文件的方法不正确,并且忽略了空目录。这一定是svn更新导致的崩溃。工作副本中不存在异常消息中的“tmp”文件夹。extract方法主体现在如下所示:
FastZip fastZip = new FastZip();
string fileFilter = ".*";
fastZip.CreateEmptyDirectories = true;
// Will always overwrite if target filenames already exist
fastZip.ExtractZip(localZipFileNameAndPath, extractDir, fileFilter);
FastZip fastZip = new FastZip();
string fileFilter = ".*";
fastZip.CreateEmptyDirectories = true;
// Will always overwrite if target filenames already exist
fastZip.ExtractZip(localZipFileNameAndPath, extractDir, fileFilter);