示例#1
0
 private void SetupSvnProvider()
 {
     m_svnClient = new SvnClient();
     m_svnClient.AddUsernameProvider();
     m_svnClient.AddPromptProvider(new SvnAuthProviderObject.SimplePrompt(SimpleAuth), IntPtr.Zero, 2);
     m_svnClient.OpenAuth();
     m_svnClient.Context.LogMsgFunc2 = new SvnDelegate(new SvnClient.GetCommitLog2(GetCommitLogCallback));
 }
示例#2
0
 private void SetupSvnProvider()
 {
     m_svnClient = new SvnClient();
     m_svnClient.AddUsernameProvider();
     m_svnClient.AddPromptProvider(new SvnAuthProviderObject.SimplePrompt(SimpleAuth), IntPtr.Zero, 2);
     m_svnClient.OpenAuth();
     m_svnClient.Context.LogMsgFunc2 = new SvnDelegate(new SvnClient.GetCommitLog2(GetCommitLogCallback));
 }
示例#3
0
        public virtual int Run(Application.SubCommand sc, string[] args)
        {
            int res;

            mSubCmd = sc;
            BreakSingleDashManyLettersIntoManyOptions = true;
            ProcessArgs(args);

            try {
                AprPool          p   = Svn.PoolCreate();
                SvnClientContext ctx = SvnClientContext.Create(p);
                if (oConfigDir != null)
                {
                    ctx.Config = SvnConfig.GetConfig(new SvnPath(oConfigDir, p), p);
                }
                else
                {
                    ctx.Config = SvnConfig.GetConfig(p);
                }

                client = new SvnClient(ctx, p);

                client.AddSimpleProvider();
                client.AddUsernameProvider();
                client.AddSslServerTrustFileProvider();
                client.AddSslClientCertFileProvider();
                client.AddSslClientCertPwFileProvider();

                if (oInteractive)
                {
                    client.AddPromptProvider(
                        new SvnAuthProviderObject.SimplePrompt(SimpleAuth),
                        IntPtr.Zero, 2);
                    client.AddPromptProvider(
                        new SvnAuthProviderObject.UsernamePrompt(UsernameAuth),
                        IntPtr.Zero, 2);
                    client.AddPromptProvider(
                        new SvnAuthProviderObject.SslServerTrustPrompt(SslServerTrustAuth),
                        IntPtr.Zero);
                }
                client.OpenAuth();

                if (!oQuiet)
                {
                    client.Context.NotifyFunc = new SvnDelegate(new SvnWcNotify.Func(NotifyCallback));
                }

                client.Context.LogMsgFunc = new SvnDelegate(new SvnClient.GetCommitLog(GetCommitLogCallback));
                client.Context.CancelFunc = new SvnDelegate(new Svn.CancelFunc(CancelCallback));

                res = Execute();
            }
            catch (Exception e)
            {
                if (oDebug)
                {
                    Console.WriteLine(e);
                }
                else
                {
                    Console.WriteLine(e.Message);
                }
                res = -1;
            }
            finally
            {
                client.Pool.Destroy();
            }
            return(res);
        }