Problem with commit in sharpsvn

Posted by zhangxiaoning on Stack Overflow See other posts from Stack Overflow or by zhangxiaoning
Published on 2010-05-13T07:00:38Z Indexed on 2010/05/13 7:04 UTC
Read the original article Hit count: 230

Filed under:

Hi,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!

© Stack Overflow or respective owner

Related posts about sharpsvn