Exemplo n.º 1
0
        private void AddTreeNode(ChangeDetails detail)
        {
            try
            {

                var details = detail.FileName.Split('/');
                TreeNode node;
                foreach (var item in details)
                {

                    if (treeViewFiles.Nodes.ContainsKey(item))
                    {
                        node = treeViewFiles.Nodes.Find(item, false).First();
                    }
                    else
                    {
                        node = new TreeNode(item);
                        node.Tag = detail;
                        treeViewFiles.Nodes.Add(node);
                    }
                }

                node = new TreeNode(detail.ChangeDate.ToString());
                node.Tag = detail;
                node.Nodes.Add(node);

            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Exemplo n.º 2
0
        private void AddTreeNode(ChangeDetails detail)
        {
            try
            {
                var      details = detail.FileName.Split('/');
                TreeNode node;
                foreach (var item in details)
                {
                    if (treeViewFiles.Nodes.ContainsKey(item))
                    {
                        node = treeViewFiles.Nodes.Find(item, false).First();
                    }
                    else
                    {
                        node     = new TreeNode(item);
                        node.Tag = detail;
                        treeViewFiles.Nodes.Add(node);
                    }
                }

                node     = new TreeNode(detail.ChangeDate.ToString());
                node.Tag = detail;
                node.Nodes.Add(node);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Exemplo n.º 3
0
        private void GetGitDetails()
        {
            this.Cursor = Cursors.WaitCursor;
            var tree = _repo.Head;

            if (_repo.Head.CurrentCommit != null)
            {
                GitDetails = new Dictionary <string, List <ChangeDetails> >();
            }

            foreach (Commit commit in _repo.Head.CurrentCommit.Ancestors)
            {
                foreach (Change change in commit.Changes)
                {
                    ChangeDetails details = new ChangeDetails();
                    details.FileName   = change.Path;
                    details.Hash       = commit.Hash;
                    details.ChangeDate = commit.AuthorDate;
                    details.UserName   = commit.Author.Name;
                    details.Message    = commit.Message;

                    if (!GitDetails.ContainsKey(change.Path))
                    {
                        GitDetails.Add(change.Path, new List <ChangeDetails>());
                    }
                    GitDetails[change.Path].Add(details);
                }
            }
            this.Cursor = Cursors.Default;
        }
Exemplo n.º 4
0
        private void GetGitDetails()
        {
            this.Cursor = Cursors.WaitCursor;
            var tree = _repo.Head;
            if (_repo.Head.CurrentCommit != null)
                GitDetails = new Dictionary<string, List<ChangeDetails>>();

                foreach (Commit commit in _repo.Head.CurrentCommit.Ancestors)
                {
                    foreach (Change change in commit.Changes)
                    {
                        ChangeDetails details = new ChangeDetails();
                        details.FileName = change.Path;
                        details.Hash = commit.Hash;
                        details.ChangeDate = commit.AuthorDate;
                        details.UserName = commit.Author.Name;
                        details.Message = commit.Message;

                        if (!GitDetails.ContainsKey(change.Path)) GitDetails.Add(change.Path, new List<ChangeDetails>());
                        GitDetails[change.Path].Add(details);

                    }
                }
            this.Cursor = Cursors.Default;
        }