SharpSVN Commit 中的本地目录参数
当尝试在 SharpSVN 中提交某些内容时,您是否使用本地路径?我不明白这个库如何与在线颠覆存储库一起使用。很困惑。任何帮助都会很棒。听到的是我如何尝试承诺......
using (SvnClient client = new SvnClient())
{
SvnCommitArgs args = new SvnCommitArgs();
args.LogMessage = message;
args.ThrowOnError = true;
args.ThrowOnCancel = true;
try
{
return client.Commit(path, args);
}
catch (Exception e)
{
if (e.InnerException != null)
{
throw new Exception(e.InnerException.Message, e);
}
throw e;
}
}
Do you use the local path when attempting to commit something in SharpSVN? I am not understanding how this library works with an online subversion repository. Very confused. any help would be great. hear is how I attempt to commit...
using (SvnClient client = new SvnClient())
{
SvnCommitArgs args = new SvnCommitArgs();
args.LogMessage = message;
args.ThrowOnError = true;
args.ThrowOnCancel = true;
try
{
return client.Commit(path, args);
}
catch (Exception e)
{
if (e.InnerException != null)
{
throw new Exception(e.InnerException.Message, e);
}
throw e;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Subversion 中,您将更改从本地工作副本提交到存储库。
因此,您首先签出工作副本(例如使用 SvnClient.CheckOut),然后执行一些更改。
完成更改后,您将所有更改提交到存储库。请参阅 http://svnbook.red-bean.com/ 了解基本的颠覆信息。
ThrowOnError 默认为 true,因此您不必设置它。为了允许取消,您需要设置一些回调,因此您通常可以忽略这种情况。
如果出现提交错误,Subversion 通常会同时返回多个错误,因此您不仅要查看外部异常或内部异常之一,还要查看整个错误链。
In Subversion you commit changes from a local working copy to a repository.
So you first checkout a working copy (E.g. with SvnClient.CheckOut), then you perform some changes.
And after you are done performing changes you commit all your changes to the repository. See http://svnbook.red-bean.com/ for basic subversion information.
ThrowOnError defaults to true, so you don't have to set that. And to allow cancelling you need to set some callbacks, so you can usually just ignore that case.
In case of commit errors Subversion usually returns several errors at once, so you don't just want to look at the outer or one of the inner exceptions, but to the entire error chain.