Sharpsvn 中的提交问题
我是中国的一名程序员。 我想将计算机中工作副本的更改提交到存储库。存储库位于 URL 中,我现在正在执行此操作:
using (SvnClient client = new SvnClient()){
string path = @"C:\testdelete\test.java";
client.Delete(path);
client.Authentication.Clear(); // Clear predefined handlers
client.Authentication.UserNamePasswordHandlers += delegate(object obj, SharpSvn.Security.SvnUserNamePasswordEventArgs args)
{
args.UserName = "username";
args.Password = "password";
};
var uri = client.GetUriFromWorkingCopy(path);
if (uri != null)
{
SvnCommitArgs args = new SvnCommitArgs();
args.ThrowOnError = true;
args.ThrowOnCancel = true;
client.Commit(path, args);//here throw a SvnOperationCanceledException
}
}
但它不起作用,为什么?谢谢!
I'm a programmer in china.
I want to commit the changes of a working copy in my computer to the repository. The repository is in an URL and i´m doing this now:
using (SvnClient client = new SvnClient()){
string path = @"C:\testdelete\test.java";
client.Delete(path);
client.Authentication.Clear(); // Clear predefined handlers
client.Authentication.UserNamePasswordHandlers += delegate(object obj, SharpSvn.Security.SvnUserNamePasswordEventArgs args)
{
args.UserName = "username";
args.Password = "password";
};
var uri = client.GetUriFromWorkingCopy(path);
if (uri != null)
{
SvnCommitArgs args = new SvnCommitArgs();
args.ThrowOnError = true;
args.ThrowOnCancel = true;
client.Commit(path, args);//here throw a SvnOperationCanceledException
}
}
But it doesn´t work,Why?Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我得到了它。
必须设置SvnCommitArg的LogMessage。
I got it.
The LogMessage of SvnCommitArg must be setted.