Exemple #1
0
        public void GroupHistoryByTimeStampInFolderIfAddingOneFile()
        {
            var repo    = DXVcsConnectionHelper.Connect(DefaultConfig.Config.AuxPath);
            var history = repo.GetProjectHistory(@"$/Sandbox/litvinov/DXVcsTest/testhistory", true, new DateTime(2015, 9, 9), new DateTime(2015, 9, 10));
            var grouped = history.GroupBy(x => x.ActionDate).ToList();

            Assert.AreEqual(3, grouped.Count);
        }
Exemple #2
0
        public FileDiffInfo GetFileDiffInfo(string filePath, Action <int, int> progress)
        {
            IDXVcsRepository dxRepository = DXVcsConnectionHelper.Connect(PortOptions.VcsServer);
            MergeHelper      helper       = new MergeHelper(toolWindowViewModel);
            string           vcsFile      = helper.GetMergeVcsPathByOriginalPath(filePath, PortOptions.MasterBranch);

            return(dxRepository.GetFileDiffInfo(vcsFile, progress, SpacesAction.IgnoreAll));
        }
Exemple #3
0
        public void GetProjectHistoryFromTestHistory()
        {
            var repo    = DXVcsConnectionHelper.Connect(DefaultConfig.Config.AuxPath);
            var history = repo.GetProjectHistory(@"$/Sandbox/litvinov/DXVcsTest/testhistory", true, new DateTime(2015, 9, 9), new DateTime(2015, 9, 10));

            Assert.AreEqual(3, history.Count());
            Assert.AreEqual(@"9/9/2015 7:30:57 PM,,,Create,,Project,Litvinov,1", FormatProjectHistoryItem(history[0]));
            Assert.AreEqual(@"9/9/2015 7:31:09 PM,,,Shared from $/Sandbox/litvinov/DXVcsTest/test.txt,test.txt,File,Litvinov,2", FormatProjectHistoryItem(history[1]));
            Assert.AreEqual(@"9/9/2015 7:05:37 PM,,,Checked in (2),test.txt,File,Litvinov,2", FormatProjectHistoryItem(history[2]));
        }
Exemple #4
0
        public void TestFindCreateBranchTimeStamp()
        {
            var repo    = DXVcsConnectionHelper.Connect(DefaultConfig.Config.AuxPath);
            var vcsPath = @"$/2014.1/XPF/DevExpress.Xpf.Core/DevExpress.Xpf.Core";
            var history = repo.GetProjectHistory(vcsPath, true);
            var create  = history.Where(IsBranchCreatedTimeStamp).ToList();

            Assert.AreEqual(1, create.Count);
            Assert.AreEqual(635187859620700000, create[0].ActionDate.Ticks);
            //var projectHistory = history.Reverse().GroupBy(x => x.ActionDate).OrderBy(x => x.First().ActionDate).Select(x => new HistoryItem(x.First().ActionDate, x.ToList()));
            //var project = projectHistory.Where(x => x.History.Any(h => h.Message != null && h.Message.ToLowerInvariant().Contains("branch"))).ToList();
        }
Exemple #5
0
        public void GroupHistoryByTimeStampInFolderIfAddingTwoFiles()
        {
            var repo    = DXVcsConnectionHelper.Connect(DefaultConfig.Config.AuxPath);
            var history = repo.GetProjectHistory(@"$/Sandbox/litvinov/DXVcsTest/testhistorybyaddingtwofiles", true, new DateTime(2015, 9, 9), new DateTime(2015, 9, 10));
            var grouped = history.GroupBy(x => x.ActionDate).ToList();

            Assert.AreEqual(4, grouped.Count);
            Assert.AreEqual(@"9/9/2015 7:45:26 PM,,,Create,,Project,Litvinov,1", FormatProjectHistoryItem(grouped[0].ToList()[0]));
            Assert.AreEqual(@"9/9/2015 7:46:32 PM,1,,Created,1.txt,File,Litvinov,2", FormatProjectHistoryItem(grouped[1].ToList()[0]));
            Assert.AreEqual(@"9/9/2015 7:46:32 PM,1,,Created,2.txt,File,Litvinov,3", FormatProjectHistoryItem(grouped[2].ToList()[0]));
            Assert.AreEqual(@"9/9/2015 7:47:22 PM,1,,Checked in (2),1.txt,File,Litvinov,2", FormatProjectHistoryItem(grouped[3].ToList()[0]));
            Assert.AreEqual(@"9/9/2015 7:47:22 PM,1,,Checked in (2),2.txt,File,Litvinov,2", FormatProjectHistoryItem(grouped[3].ToList()[1]));
        }
        FileDiffInfo GetHistoryData()
        {
            string           vcsFile;
            IDXVcsRepository dxRepository;

            if (direct)
            {
                dxRepository = DXVcsConnectionHelper.Connect(fileSource);
                vcsFile      = fileName;
            }
            else
            {
                dxRepository = DXVcsConnectionHelper.Connect(fileName, fileSource, out vcsFile);
            }
            return(dxRepository.GetFileDiffInfo(vcsFile));
        }
Exemple #7
0
        //void ShowExternalBlameInternal(Uri svnFile, int? lineNumber) {
        //    if (string.IsNullOrEmpty(svnFile.ToString()))
        //        throw new ArgumentException("svnFile");

        //    var startInfo = new ProcessStartInfo();
        //    startInfo.FileName = GetTortoiseProcPath();
        //    startInfo.Arguments = string.Format("/command:blame /path:{0} /startrev:0 /endrev:-1", svnFile.AbsoluteUri);

        //    if (lineNumber.HasValue)
        //        startInfo.Arguments += string.Format(" /line:{0}", lineNumber);

        //    using (Process process = Process.Start(startInfo)) {
        //        process.WaitForExit();
        //    }
        //}
        void PrepareBlameFileAndShowBlameUI(string filePath, int?lineNumber)
        {
            string blameFile = null;
            string logFile   = null;

            try {
                IDXVcsRepository dxRepository = DXVcsConnectionHelper.Connect(portOptions.VcsServer);
                MergeHelper      helper       = new MergeHelper(options, portOptions);
                string           vcsFile      = helper.GetMergeVcsPathByOriginalPath(filePath, portOptions.MasterBranch);

                FileDiffInfo       diffInfo = dxRepository.GetFileDiffInfo(vcsFile);
                int                revision = diffInfo.LastRevision;
                IList <IBlameLine> blame    = diffInfo.BlameAtRevision(revision);
                blameFile = MakeBlameFile(vcsFile, blame);
                logFile   = MakeLog(blame);
                ShowExternalBlameInternal(filePath, vcsFile, blameFile, logFile, revision, lineNumber);
            }
            finally {
                blameFile.Do(File.Delete);
                logFile.Do(File.Delete);
            }
        }
Exemple #8
0
 public void GetProjectForTimeStamp()
 {
     var repo = DXVcsConnectionHelper.Connect(DefaultConfig.Config.AuxPath);
 }
Exemple #9
0
        public void SimpleStart()
        {
            var repo = DXVcsConnectionHelper.Connect(DefaultConfig.Config.AuxPath);

            Assert.IsNotNull(repo);
        }