예제 #1
0
        public void ParseBlame(string fileName, int lineNumber)
        {
            CaseSensFileName = GetProperFilePathCapitalization(fileName);
            Revision         = 0;
            Author           = "unknown";

            try
            {
                using (var client = new SvnClient())
                {
                    client.Authentication.DefaultCredentials = new NetworkCredential("vivabuild", "#%tsargWV45!@^@gvtRSW");
                    SvnTarget target = SvnPathTarget.FromString(CaseSensFileName);
                    Collection <SvnBlameEventArgs> list;
                    client.GetBlame(target, out list);
                    int idx = lineNumber - 1;
                    if (0 <= idx && idx < list.Count)
                    {
                        Revision = list[idx].Revision;
                        Author   = list[idx].Author;
                    }
                }
            }
            catch (Exception)
            {
                ;
            }
            AddAuthor(Author);
        }
예제 #2
0
 private void GetSVNRevision()
 {
     using (SvnClient client = new SvnClient())
     {
         SvnInfoEventArgs info;
         SVNVersion = client.GetInfo(SvnPathTarget.FromString(Path), out info) ? info.Revision : 0;
     }
 }
예제 #3
0
        public void Path_NormalizingPathsDot()
        {
            Assert.That(SvnTools.IsNormalizedFullPath("C:\\source\\."), Is.False);
            Assert.That(SvnTools.IsNormalizedFullPath("C:\\source\\.\\"), Is.False);
            Assert.That(SvnTools.IsNormalizedFullPath("C:\\source\\.\\dump"), Is.False);

            Assert.That(SvnTools.IsAbsolutePath("C:\\source\\."), Is.False);
            Assert.That(SvnTools.IsAbsolutePath("C:\\source\\.\\"), Is.False);
            Assert.That(SvnTools.IsAbsolutePath("C:\\source\\.\\dump"), Is.False);

            Assert.That(SvnPathTarget.FromString("C:\\source\\.").TargetPath, Is.EqualTo("C:\\source"));
            Assert.That(SvnPathTarget.FromString("C:\\source\\.\\").TargetPath, Is.EqualTo("C:\\source"));
            Assert.That(SvnPathTarget.FromString("C:\\source\\.\\dump").TargetPath, Is.EqualTo("C:\\source\\dump"));

            Assert.That(SvnTools.IsNormalizedFullPath("c:\\source"), Is.False);
            Assert.That(SvnTools.IsAbsolutePath("c:\\source"), Is.True);

            Assert.That(SvnPathTarget.FromString("c:\\source\\.").TargetPath, Is.EqualTo("C:\\source"));
            Assert.That(SvnPathTarget.FromString("c:\\source\\.\\").TargetPath, Is.EqualTo("C:\\source"));
            Assert.That(SvnPathTarget.FromString("c:\\source\\.\\dump").TargetPath, Is.EqualTo("C:\\source\\dump"));
        }
예제 #4
0
        /// <summary>
        /// Checks the SVN.
        /// </summary>
        private void checkSVN()
        {
            SvnClient        __svnClient = new SvnClient();
            SvnInfoEventArgs __sieaInfo;
            bool             __getInfo;

            //MessageBox.Show(__versionFilePath);
            if (__versionFilePath != "")
            {
                try
                {
                    __getInfo = __svnClient.GetInfo(SvnPathTarget.FromString(GetSourcePath() + __versionFilePath + settingObject.ClassName + ".as"), out __sieaInfo);
                    //MessageBox.Show(__sieaInfo.ToString());
                    pluginUI.Revision.Text = __sieaInfo.LastChangeRevision.ToString();
                    __vRevision            = (int)__sieaInfo.LastChangeRevision;
                }
                catch (SvnException e)
                {
                    try
                    {
                        //MessageBox.Show(">" + e.Message);
                        __getInfo = __svnClient.GetInfo(SvnPathTarget.FromString(GetSourcePath() + __versionFilePath), out __sieaInfo);
                        pluginUI.Revision.Text = __sieaInfo.LastChangeRevision.ToString();
                        __vRevision            = (int)__sieaInfo.LastChangeRevision;
                    }
                    catch (SvnException ex)
                    {
                        __vRevision            = 0;
                        pluginUI.Revision.Text = "";
                    }
                }
            }
            else
            {
                __vRevision            = 0;
                pluginUI.Revision.Text = "";
            }
        }