Пример #1
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);
        }
Пример #2
0
 // svn_log_message_receiver_t Wrapper
 public SvnDelegate(SvnClient.LogMessageReceiver func)
 {
     mFunc = func;
     mWrapperFunc = new Svn.svn_log_message_receiver_t(SvnLogMessageReceiverWrapper);
 }
Пример #3
0
 // svn_client_blame_receiver_t Wrapper
 public SvnDelegate(SvnClient.BlameReceiver func)
 {
     mFunc = func;
     mWrapperFunc = new Svn.svn_client_blame_receiver_t(SvnClientBlameReceiverWrapper);
 }
Пример #4
0
 // svn_client_get_commit_log_t Wrapper
 public SvnDelegate(SvnClient.GetCommitLog func)
 {
     mFunc = func;
     mWrapperFunc = new Svn.svn_client_get_commit_log_t(SvnClientGetCommitLogWrapper);
 }