예제 #1
0
        private int vaultPopulateInfo(string repoPath, IDictionary <string, VaultVersionInfo> info)
        {
            var ticks = Environment.TickCount;

            string[] PathToBranch = repoPath.Split('~');
            string   path         = PathToBranch[0];
            string   branch       = PathToBranch[1];

            VaultTxHistoryItem[]  historyItems;
            VaultClientFolderColl repoFolders;

            if (repoPath.EndsWith("*"))
            {
                repoFolders = ServerOperations.ProcessCommandListFolder(path, false).Folders;
            }
            else
            {
                repoFolders = new VaultClientFolderColl();

                repoFolders.Add(ServerOperations.ProcessCommandListFolder(path, false));
            }

            foreach (VaultClientFolder f in repoFolders)
            {
                string branchName;

                if (branch == "*")
                {
                    branchName = Tools.GetBranchMapping(f.Name);
                }
                else
                {
                    branchName = Tools.GetBranchMapping(branch);
                }

                string EndDate = (f.Name == "SAS") ? "2016-01-23" : RevisionEndDate;

                historyItems = ServerOperations.ProcessCommandVersionHistory(f.FullPath,
                                                                             0,
                                                                             VaultDateTime.Parse(RevisionStartDate),
                                                                             VaultDateTime.Parse(EndDate),
                                                                             0);

                foreach (VaultTxHistoryItem i in historyItems)
                {
                    info.Add(i.TxDate.GetDateTime().ToString("yyyy-MM-ddTHH:mm:ss.fff") + ':' + branchName, new VaultVersionInfo()
                    {
                        Branch    = branchName,
                        Path      = f.FullPath,
                        Version   = i.Version,
                        TxId      = i.TxID,
                        Comment   = i.Comment,
                        Login     = i.UserLogin,
                        TimeStamp = i.TxDate
                    });
                }
            }

            return(Environment.TickCount - ticks);
        }
        private ChangeSetItemColl DetectChanges()
        {
            Console.WriteLine("Detecting changes");
            var changes = new ChangeSetItemColl();
            var folder  = ServerOperations.ProcessCommandListFolder(_repoFolder, true);

            HandleModifiesAndDeletes(folder, changes, true);
            HandleAdds(folder, changes);

            return(changes);
        }