コード例 #1
0
ファイル: CmdBase.cs プロジェクト: tforsberg/SubversionSharp
        public SvnError UsernameAuth(out SvnAuthCredUsername cred, IntPtr baton,
                                     AprString realm, bool maySave, AprPool pool)
        {
            Console.WriteLine("Username Authentication:");
            Console.WriteLine("------------------------");
            Console.WriteLine("Realm: {0}", realm);
            Console.WriteLine("");

            bool   valid = false;
            string line  = "";

            while (!valid)
            {
                Console.Write("Enter Username: ");

                line = Console.ReadLine();

                if (line.Trim().Length > 0)
                {
                    valid = true;
                }
            }

            cred          = SvnAuthCredUsername.Alloc(pool);
            cred.Username = new AprString(line, pool);
            cred.MaySave  = maySave;
            return(SvnError.NoError);
        }
コード例 #2
0
        public void Duplicate()
        {
            AprPool p = AprPool.Create();

            Assert.IsFalse(p.IsNull, "#A01");

            AprString s = new AprString();

            Assert.IsTrue(s.IsNull, "#A02");

            s = AprString.Duplicate(p, "This is a test of string duplication");
            Assert.IsFalse(s.IsNull, "#A03");
            Assert.AreEqual("This is a test of string duplication", s.ToString(), "#A04");

            AprString s2 = AprString.Duplicate(p, s);

            Assert.IsFalse(s2.IsNull, "#A05");
            Assert.AreEqual("This is a test of string duplication", s2.ToString(), "#A06");

            s2 = AprString.Duplicate(p, s, 14);
            Assert.IsFalse(s2.IsNull, "#A07");
            Assert.AreEqual("This is a test", s2.ToString(), "#A08");

            s = AprString.Duplicate(p, "This is a test of string duplication", 14);
            Assert.IsFalse(s.IsNull, "#A09");
            Assert.AreEqual("This is a test", s.ToString(), "#A10");

            p.Destroy();
            Assert.IsTrue(p.IsNull, "#A11");
        }
コード例 #3
0
        private SvnError UsernameAuth(out SvnAuthCredUsername cred, IntPtr baton, AprString realm, bool maySave, AprPool pool)
        {
            cred          = SvnAuthCredUsername.Alloc(pool);
            cred.Username = new AprString(this.UserName, pool);
            cred.MaySave  = maySave;

            return(SvnError.NoError);
        }
コード例 #4
0
 public SvnError SimpleAuth(out SvnAuthCredSimple cred, IntPtr baton, AprString realm, AprString username, bool maySave, AprPool pool)
 {
     cred          = SvnAuthCredSimple.Alloc(pool);
     cred.Username = new AprString(this.UserName, pool);
     cred.Password = new AprString(this.Password, pool);
     cred.MaySave  = maySave;
     return(SvnError.NoError);
 }
コード例 #5
0
        public SvnData(AprString str, AprPool pool)
        {
            SvnError err = Svn.svn_utf_cstring_to_utf8(out mString, str, pool);

            if (!err.IsNoError)
            {
                throw new SvnException(err);
            }
        }
コード例 #6
0
        // private void CheckoutSvnPartial(string subdir)
        // {
        //     if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
        //         Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);

        //     m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false);
        // }

        // private void CheckoutSvnPartial(string subdir, SvnRevision revision)
        // {
        //     if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
        //         Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);

        //     m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, revision, revision, true, false);
        // }

        #endregion

        #region SvnDotNet Callbacks

        private SvnError SimpleAuth(out SvnAuthCredSimple svnCredentials, IntPtr baton,
                                    AprString realm, AprString username, bool maySave, AprPool pool)
        {
            svnCredentials          = SvnAuthCredSimple.Alloc(pool);
            svnCredentials.Username = new AprString(m_svnuser, pool);
            svnCredentials.Password = new AprString(m_svnpass, pool);
            svnCredentials.MaySave  = false;
            return(SvnError.NoError);
        }
コード例 #7
0
        public SvnError SslServerTrustAuth(out SvnAuthCredSslServerTrust cred,
                                           IntPtr baton, AprString realm,
                                           SvnAuthCredSslServerTrust.CertFailures failures,
                                           SvnAuthSslServerCertInfo certInfo,
                                           bool maySave, IntPtr pool)
        {
            this.Log(Level.Warning, "Error validating server certificate for '{0}':", realm);
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.UnknownCA) > 0)
            {
                this.Log(Level.Warning, " - The certificate is not issued by a trusted authority");
            }
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.CNMismatch) > 0)
            {
                this.Log(Level.Warning, " - The certificate hostname does not match");
            }
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.NotYetValid) > 0)
            {
                this.Log(Level.Warning, " - The certificate is not yet valid");
            }
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.Expired) > 0)
            {
                this.Log(Level.Warning, " - The certificate has expired");
            }
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.Other) > 0)
            {
                this.Log(Level.Warning, " - The certificate has an unknown error");
            }

            this.Log(Level.Warning, "Certificate informations:");
            this.Log(Level.Warning, "\tHostName:    " + certInfo.Hostname);
            this.Log(Level.Warning, "\tIssuer:      " + certInfo.IssuerDName);
            this.Log(Level.Warning, "\tValid From:  " + certInfo.ValidFrom);
            this.Log(Level.Warning, "\tValid Until: " + certInfo.ValidUntil);
            this.Log(Level.Warning, "\tFingerprint: " + certInfo.Fingerprint);

            cred = SvnAuthCredSslServerTrust.Alloc(pool);

            if (this.AcceptCertificate == AcceptCertificate.Reject)
            {
                cred.AcceptedFailures = 0;
                cred.MaySave          = false;
            }
            else if (this.AcceptCertificate == AcceptCertificate.Temporarily)
            {
                cred.AcceptedFailures = failures;
                cred.MaySave          = false;
            }
            else if (this.AcceptCertificate == AcceptCertificate.Permanently)
            {
                cred.AcceptedFailures = failures;
                cred.MaySave          = true;
            }

            return(SvnError.NoError);
        }
コード例 #8
0
 public override string ToString()
 {
     if (IsNull)
     {
         return("[svn_data:NULL]");
     }
     else
     {
         int len = new AprString(mString).Length;
         if (len == 0)
         {
             return("");
         }
         byte[] str = new byte[len];
         Marshal.Copy(mString, str, 0, len);
         return(Encoder.GetString(str));
     }
 }
コード例 #9
0
        private SvnError GetCommitLogCallback(out AprString logMessage, out SvnPath tmpFile, AprArray commitItems, IntPtr baton, AprPool pool)
        {
            if (!commitItems.IsNull)
            {
                foreach (SvnClientCommitItem2 item in commitItems)
                {
                    m_log.Debug("[SVNBACKUP]: ... " + Path.GetFileName(item.Path.ToString()) + " (" + item.Kind.ToString() + ") r" + item.Revision.ToString());
                }
            }

            string msg = "Region Backup (" + System.Environment.MachineName + " at " + DateTime.UtcNow + " UTC)";

            m_log.Debug("[SVNBACKUP]: Saved with message: " + msg);

            logMessage = new AprString(msg, pool);
            tmpFile    = new SvnPath(pool);

            return(SvnError.NoError);
        }
コード例 #10
0
ファイル: CmdBase.cs プロジェクト: tforsberg/SubversionSharp
        public SvnError SimpleAuth(out SvnAuthCredSimple cred, IntPtr baton,
                                   AprString realm, AprString username,
                                   bool maySave, AprPool pool)
        {
            Console.WriteLine("Simple Authentication");
            Console.WriteLine("---------------------");
            Console.WriteLine("Realm: {0}", realm);
            Console.WriteLine("");

            bool   valid = false;
            string line  = "";

            while (!valid)
            {
                if (!username.IsNull)
                {
                    Console.Write("Enter Username ({0}): ", username);
                }
                else
                {
                    Console.Write("Enter Username: "******"Enter Password: ");
            cred.Password = new AprString(Console.ReadLine(), pool);
            cred.MaySave  = maySave;
            return(SvnError.NoError);
        }
コード例 #11
0
        public void SetParameter(Param param, IntPtr value)
        {
            CheckPtr();
            if (mParamName == null)
            {
                mParamName = new IntPtr[ParamName.Length];
                for (int i = 0; i < ParamName.Length; i++)
                {
                    mParamName[i] = IntPtr.Zero;
                }
            }

            if (mParamName[(int)param] == IntPtr.Zero)
            {
                mParamName[(int)param] = new AprString(ParamName[(int)param], mPool);
            }

            Debug.WriteLine(String.Format("svn_auth_set_parameter({0},{1:X},{2:X})", this, mParamName[(int)param].ToInt32(), value.ToInt32()));
            Svn.svn_auth_set_parameter(mAuthBaton, mParamName[(int)param], value);
        }
コード例 #12
0
ファイル: CmdBase.cs プロジェクト: tforsberg/SubversionSharp
        public SvnError GetCommitLogCallback(out AprString logMessage, out SvnPath tmpFile,
                                             AprArray commitItems, IntPtr baton,
                                             AprPool pool)
        {
            if (!commitItems.IsNull)
            {
                foreach (SvnClientCommitItem item in commitItems)
                {
                    Console.WriteLine("C1: {1} ({2}) r{3}",
                                      item.Path, item.Kind, item.Revision);
                    Console.WriteLine("C2: {1} -> {2}",
                                      item.Url,
                                      item.CopyFromUrl);
                }
                Console.WriteLine();
            }

            Console.Write("Enter log message: ");
            logMessage = new AprString(Console.ReadLine(), pool);
            tmpFile    = new SvnPath(pool);

            return(SvnError.NoError);
        }
コード例 #13
0
        public IntPtr GetParameter(Param param)
        {
            CheckPtr();
            if (mParamName == null)
            {
                mParamName = new IntPtr[ParamName.Length];
                for (int i = 0; i < ParamName.Length; i++)
                {
                    mParamName[i] = IntPtr.Zero;
                }
            }

            if (mParamName[(int)param] == IntPtr.Zero)
            {
                mParamName[(int)param] = new AprString(ParamName[(int)param], mPool);
            }

            IntPtr ptr;

            Debug.Write(String.Format("svn_auth_get_parameter({0},{1:X})...", this, mParamName[(int)param].ToInt32()));
            ptr = Svn.svn_auth_get_parameter(mAuthBaton, mParamName[(int)param]);
            Debug.WriteLine(String.Format("Done({0:X})", ptr.ToInt32()));
            return(ptr);
        }
コード例 #14
0
ファイル: CmdBase.cs プロジェクト: tforsberg/SubversionSharp
        public void NotifyCallback(IntPtr baton, SvnPath Path,
                                   SvnWcNotify.Action action, Svn.NodeKind kind,
                                   AprString mimeType, SvnWcNotify.State contentState,
                                   SvnWcNotify.State propState, int revNum)
        {
            switch (action)
            {
            case SvnWcNotify.Action.Add:
                if (!mimeType.IsNull && !mimeType.ToString().StartsWith("text/"))
                {
                    Console.WriteLine("A  (bin)  {0}", Path);
                }
                else
                {
                    Console.WriteLine("A         {0}", Path);
                }
                mChanged = true;
                break;

            case SvnWcNotify.Action.BlameRevision:
                break;

            case SvnWcNotify.Action.CommitAdded:
                if (!mimeType.IsNull && !mimeType.ToString().StartsWith("text/"))
                {
                    Console.WriteLine("Adding  (bin)  {0}", Path);
                }
                else
                {
                    Console.WriteLine("Adding         {0}", Path);
                }
                break;

            case SvnWcNotify.Action.CommitDeleted:
                Console.WriteLine("Deleting       {0}", Path);
                break;

            case SvnWcNotify.Action.CommitModified:
                Console.WriteLine("Sending        {0}", Path);
                break;

            case SvnWcNotify.Action.CommitReplaced:
                Console.WriteLine("Replacing      {0}", Path);
                break;

            case SvnWcNotify.Action.Copy:
                break;

            case SvnWcNotify.Action.Delete:
                Console.WriteLine("D         {0}", Path);
                mChanged = true;
                break;

            case SvnWcNotify.Action.FailedRevert:
                Console.WriteLine("Failed to revert '{0}' -- try updating instead.", Path);
                break;

            case SvnWcNotify.Action.PostfixTxdelta:
                if (!mTxDelta)
                {
                    Console.Write("Transmitting file data ");
                    mTxDelta = true;
                }
                Console.Write(".");
                break;

            case SvnWcNotify.Action.Resolved:
                Console.WriteLine("Resolved conflicted state of '{0}'", Path);
                break;

            case SvnWcNotify.Action.Restore:
                Console.WriteLine("Restored '{0}'", Path);
                break;

            case SvnWcNotify.Action.Revert:
                Console.WriteLine("Reverted '{0}'", Path);
                break;

            case SvnWcNotify.Action.Skip:
                if (contentState == SvnWcNotify.State.Missing)
                {
                    Console.WriteLine("Skipped missing target: '{0}'", Path);
                }
                else
                {
                    Console.WriteLine("Skipped '{0}'", Path);
                }
                break;

            case SvnWcNotify.Action.StatusCompleted:
                if (revNum >= 0)
                {
                    Console.WriteLine("Status against revision: {0}", revNum);
                }
                break;

            case SvnWcNotify.Action.StatusExternal:
                Console.WriteLine("\nPerforming status on external item at '{0}'", Path);
                break;

            case SvnWcNotify.Action.UpdateAdd:
                Console.WriteLine("A {0}", Path);
                mChanged = true;
                break;

            case SvnWcNotify.Action.UpdateCompleted:
                if (revNum >= 0)
                {
                    if (mSubCmd.LongName == "export")
                    {
                        Console.WriteLine("Exported {0}revision {1}.",
                                          (mInExternal) ? "external at " : "",
                                          revNum);
                    }
                    else if (mSubCmd.LongName == "checkout")
                    {
                        Console.WriteLine("Checked out {0}revision {1}.",
                                          (mInExternal) ? "external at " : "",
                                          revNum);
                    }
                    else
                    {
                        if (mChanged)
                        {
                            Console.WriteLine("Updated {0}to revision {1}.",
                                              (mInExternal) ? "external at " : "",
                                              revNum);
                        }
                        else
                        {
                            Console.WriteLine("{0}t revision {1}.",
                                              (mInExternal) ? "External a" : "A",
                                              revNum);
                        }
                    }
                }
                else                          /* no revision */
                {
                    if (mSubCmd.LongName == "export")
                    {
                        Console.WriteLine("{0}xport complete.",
                                          (mInExternal) ? "External e" : "E");
                    }
                    else if (mSubCmd.LongName == "checkout")
                    {
                        Console.WriteLine("{0}heckout complete.\n",
                                          (mInExternal) ? "External c" : "C");
                    }
                    else
                    {
                        Console.WriteLine("{0}pdate complete.\n",
                                          (mInExternal) ? "External u" : "U");
                    }
                }
                if (mInExternal)
                {
                    Console.WriteLine();
                }
                mInExternal = false;
                mChanged    = false;
                break;

            case SvnWcNotify.Action.UpdateDelete:
                Console.WriteLine("D {0}", Path);
                mChanged = true;
                break;

            case SvnWcNotify.Action.UpdateExternal:
                Console.WriteLine("\nFetching external item into '{0}'", Path);
                mInExternal = true;
                break;

            case SvnWcNotify.Action.UpdateUpdate:
                string s1 = " ";
                string s2 = " ";
                if (!((kind == Svn.NodeKind.Dir) &&
                      ((propState == SvnWcNotify.State.Inapplicable) ||
                       (propState == SvnWcNotify.State.Unknown) ||
                       (propState == SvnWcNotify.State.Unchanged))))
                {
                    mChanged = true;
                    if (kind == Svn.NodeKind.File)
                    {
                        if (contentState == SvnWcNotify.State.Conflicted)
                        {
                            s1 = "C";
                        }
                        else if (contentState == SvnWcNotify.State.Merged)
                        {
                            s1 = "G";
                        }
                        else if (contentState == SvnWcNotify.State.Changed)
                        {
                            s1 = "U";
                        }
                    }

                    if (propState == SvnWcNotify.State.Conflicted)
                    {
                        s2 = "C";
                    }
                    else if (propState == SvnWcNotify.State.Merged)
                    {
                        s2 = "G";
                    }
                    else if (propState == SvnWcNotify.State.Changed)
                    {
                        s2 = "U";
                    }

                    if (!((contentState == SvnWcNotify.State.Unchanged ||
                           contentState == SvnWcNotify.State.Unknown) &&
                          (propState == SvnWcNotify.State.Unchanged ||
                           propState == SvnWcNotify.State.Unknown)))
                    {
                        Console.WriteLine("{0}{1} {2}", s1, s2, Path);
                    }
                }
                break;
            }
        }
コード例 #15
0
 public SvnString(AprString str, AprPool pool)
 {
     mString = (svn_string_t *)(Svn.svn_string_create(str, pool)).ToPointer();
 }
コード例 #16
0
ファイル: SvnBackupModule.cs プロジェクト: N3X15/VoxelSim
        // private void CheckoutSvnPartial(string subdir)
        // {
        //     if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
        //         Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);

        //     m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false);
        // }

        // private void CheckoutSvnPartial(string subdir, SvnRevision revision)
        // {
        //     if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
        //         Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);

        //     m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, revision, revision, true, false);
        // }

        #endregion

        #region SvnDotNet Callbacks

        private SvnError SimpleAuth(out SvnAuthCredSimple svnCredentials, IntPtr baton,
                                    AprString realm, AprString username, bool maySave, AprPool pool)
        {
            svnCredentials = SvnAuthCredSimple.Alloc(pool);
            svnCredentials.Username = new AprString(m_svnuser, pool);
            svnCredentials.Password = new AprString(m_svnpass, pool);
            svnCredentials.MaySave = false;
            return SvnError.NoError;
        }
コード例 #17
0
ファイル: CmdBase.cs プロジェクト: tforsberg/SubversionSharp
        public SvnError SslServerTrustAuth(out SvnAuthCredSslServerTrust cred,
                                           IntPtr baton, AprString realm,
                                           SvnAuthCredSslServerTrust.CertFailures failures,
                                           SvnAuthSslServerCertInfo certInfo,
                                           bool maySave, IntPtr pool)
        {
            Console.WriteLine("Ssl Server Trust Prompt:");
            Console.WriteLine("------------------------");
            Console.WriteLine("");

            Console.WriteLine("Error validating server certificate for '{0}':", realm);
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.UnknownCA) > 0)
            {
                Console.WriteLine(" - The certificate is not issued by a trusted authority");
            }
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.CNMismatch) > 0)
            {
                Console.WriteLine(" - The certificate hostname does not match");
            }
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.NotYetValid) > 0)
            {
                Console.WriteLine(" - The certificate is not yet valid");
            }
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.Expired) > 0)
            {
                Console.WriteLine(" - The certificate has expired");
            }
            if ((failures & SvnAuthCredSslServerTrust.CertFailures.Other) > 0)
            {
                Console.WriteLine(" - The certificate has an unknown error");
            }

            Console.WriteLine("Certificate informations:");
            Console.WriteLine("\tHostName:    " + certInfo.Hostname);
            Console.WriteLine("\tIssuer:      " + certInfo.IssuerDName);
            Console.WriteLine("\tValid From:  " + certInfo.ValidFrom);
            Console.WriteLine("\tValid Until: " + certInfo.ValidUntil);
            Console.WriteLine("\tFingerprint: " + certInfo.Fingerprint);

            cred = SvnAuthCredSslServerTrust.Alloc(pool);
            bool valid = false;

            while (!valid)
            {
                if (maySave)
                {
                    Console.WriteLine("(R)eject, accept (t)emporarily or accept (p)ermanently? ");
                }
                else
                {
                    Console.WriteLine("(R)eject or accept (t)emporarily? ");
                }

                string line = Console.ReadLine();
                if (line.Length > 0)
                {
                    char choice = line.ToLower()[0];
                    if (choice == 'r')
                    {
                        cred.AcceptedFailures = 0;
                        cred.MaySave          = false;
                        valid = true;
                    }
                    else if (choice == 't')
                    {
                        cred.AcceptedFailures = failures;
                        cred.MaySave          = false;
                        valid = true;
                    }
                    else if (choice == 'p')
                    {
                        cred.AcceptedFailures = failures;
                        cred.MaySave          = true;
                        valid = true;
                    }
                }
            }
            return(SvnError.NoError);
        }
コード例 #18
0
 public static SvnStringBuf Create(AprString str, uint size, AprPool pool)
 {
     return(new SvnStringBuf(str, size, pool));
 }
コード例 #19
0
 public static SvnUrl Duplicate(AprPool pool, AprString str)
 {
     return(new SvnUrl(str, pool));
 }
コード例 #20
0
 public SvnStringBuf(AprString str, int size, AprPool pool)
 {
     mStringBuf = (svn_stringbuf_t *)(Svn.svn_stringbuf_ncreate(str, unchecked ((uint)size),
                                                                pool)).ToPointer();
 }
コード例 #21
0
 public SvnStringBuf(AprString str, uint size, AprPool pool)
 {
     mStringBuf = (svn_stringbuf_t *)(Svn.svn_stringbuf_ncreate(str, size, pool)).ToPointer();
 }
コード例 #22
0
 public SvnUrl(AprString str, AprPool pool)
 {
     mUrl = Svn.svn_path_uri_encode(new SvnPath(str, pool), pool);
 }
コード例 #23
0
        public void ArrayOfAprString()
        {
            AprPool p = AprPool.Create();

            Assert.IsFalse(p.IsNull, "#F01");

            AprArray a = AprArray.Make(p, 5, typeof(AprString));

            Assert.IsFalse(a.IsNull, "#F02");

            Marshal.WriteIntPtr(a.Push(), new AprString("1", p));
            Marshal.WriteIntPtr(a.Push(), new AprString("2", p));
            Marshal.WriteIntPtr(a.Push(), new AprString("3", p));
            Marshal.WriteIntPtr(a.Push(), new AprString("4", p));
            Marshal.WriteIntPtr(a.Push(), new AprString("5", p));

            AprString[] arr = new AprString[5];
            a.CopyTo(arr, 0);

            AprArray b = AprArray.LazyMake(p, a);

            Assert.AreEqual(a.ToIntPtr(), b.ToIntPtr(), "#F19");

            AprPool sp = AprPool.Create(p);

            Assert.IsFalse(sp.IsNull, "#F01");
            b = AprArray.LazyMake(sp, a);
            Assert.IsFalse(a.ToIntPtr() == b.ToIntPtr(), "#F20");

            Assert.AreEqual("5", a.PopObject().ToString(), "#F03");
            Assert.AreEqual("4", a.PopObject().ToString(), "#F04");
            Assert.AreEqual("3", a.PopObject().ToString(), "#F05");
            Assert.AreEqual("2", a.PopObject().ToString(), "#F06");
            Assert.AreEqual("1", a.PopObject().ToString(), "#F07");

            Assert.AreEqual("5", b.PopObject().ToString(), "#F21");
            Assert.AreEqual("4", b.PopObject().ToString(), "#F22");
            Assert.AreEqual("3", b.PopObject().ToString(), "#F23");
            Assert.AreEqual("2", b.PopObject().ToString(), "#F24");
            Assert.AreEqual("1", b.PopObject().ToString(), "#F25");

            Assert.AreEqual("1", arr[0].ToString(), "#F08");
            Assert.AreEqual("2", arr[1].ToString(), "#F09");
            Assert.AreEqual("3", arr[2].ToString(), "#F10");
            Assert.AreEqual("4", arr[3].ToString(), "#F11");
            Assert.AreEqual("5", arr[4].ToString(), "#F12");

            a = AprArray.Make(p, arr);

            Assert.AreEqual("5", a.PopObject().ToString(), "#F13");
            Assert.AreEqual("4", a.PopObject().ToString(), "#F14");
            Assert.AreEqual("3", a.PopObject().ToString(), "#F15");
            Assert.AreEqual("2", a.PopObject().ToString(), "#F16");
            Assert.AreEqual("1", a.PopObject().ToString(), "#F17");

            a = AprArray.LazyMake(p, new string[] { "1", "2", "3", "4", "5" }, typeof(AprString));
            Assert.AreEqual("5", a.PopObject().ToString(), "#F26");
            Assert.AreEqual("4", a.PopObject().ToString(), "#F27");
            Assert.AreEqual("3", a.PopObject().ToString(), "#F28");
            Assert.AreEqual("2", a.PopObject().ToString(), "#F29");
            Assert.AreEqual("1", a.PopObject().ToString(), "#F30");

            p.Destroy();
            Assert.IsTrue(p.IsNull, "#F18");
        }
コード例 #24
0
ファイル: SvnBackupModule.cs プロジェクト: N3X15/VoxelSim
        private SvnError GetCommitLogCallback(out AprString logMessage, out SvnPath tmpFile, AprArray commitItems, IntPtr baton, AprPool pool)
        {
            if (!commitItems.IsNull)
            {
                foreach (SvnClientCommitItem2 item in commitItems)
                {
                    m_log.Debug("[SVNBACKUP]: ... " + Path.GetFileName(item.Path.ToString()) + " (" + item.Kind.ToString() + ") r" + item.Revision.ToString());
                }
            }

            string msg = "Region Backup (" + System.Environment.MachineName + " at " + DateTime.UtcNow + " UTC)";

            m_log.Debug("[SVNBACKUP]: Saved with message: " + msg);

            logMessage = new AprString(msg, pool);
            tmpFile = new SvnPath(pool);

            return (SvnError.NoError);
        }
コード例 #25
0
 public static SvnString Create(AprString str, AprPool pool)
 {
     return(new SvnString(str, pool));
 }