public void AprTimeToDateTime()
        {
            long     at = 1087600508667000;
            DateTime dt = new DateTime(2004, 6, 18, 23, 15, 08, 667);

            Assert.AreEqual(at, AprTime.FromDateTime(dt), "#C01");
            Assert.AreEqual(dt, AprTime.ToDateTime(at), "#C02");
        }
Exemple #2
0
        protected SvnRevision StringToRevision(string value)
        {
            try {
                return(new SvnRevision(int.Parse(value)));
            }
            catch {}

            switch (value.ToUpper())
            {
            case "HEAD":
                return(new SvnRevision(Svn.Revision.Head));

            case "BASE":
                return(new SvnRevision(Svn.Revision.Base));

            case "COMMITED":
                return(new SvnRevision(Svn.Revision.Committed));

            case "PREV":
                return(new SvnRevision(Svn.Revision.Previous));

            default:
                try
                {
                    return(new SvnRevision(AprTime.FromDateTime(DateTime.Parse(value))));
                }
                catch (Exception e)
                {
                    if (oDebug)
                    {
                        Console.WriteLine(e);
                    }
                    else
                    {
                        Console.WriteLine(e.Message);
                    }
                    System.Environment.Exit(1);
                    return(-1);
                }
            }
        }