当前位置: 首页>>代码示例>>C#>>正文


C# GitCommands.CmdStartProcess方法代码示例

本文整理汇总了C#中GitCommands.GitCommands.CmdStartProcess方法的典型用法代码示例。如果您正苦于以下问题:C# GitCommands.CmdStartProcess方法的具体用法?C# GitCommands.CmdStartProcess怎么用?C# GitCommands.CmdStartProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GitCommands.GitCommands的用法示例。


在下文中一共展示了GitCommands.CmdStartProcess方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public void Execute()
        {
            Revisions = new List<GitRevision>();

            heads = GitCommands.GetHeads(true);

            if (!LogParam.Contains("=") && Settings.ShowRevisionGraph)
                LogParam = " --graph " + LogParam;

            if (Settings.OrderRevisionByDate)
                LogParam = " --date-order " + LogParam;

            string dateFormat;
            if (Settings.RelativeDate)
                dateFormat = "%cr";
            else
                dateFormat = "%cd";

            gitGetGraphCommand = new GitCommands();
            gitGetGraphCommand.CollectOutput = false;
            gitGetGraphCommand.CmdStartProcess(Settings.GitDir + "git.cmd", "log -n " + LimitRevisions + " --pretty=format:\"Commit %H %nTree:   %T%nAuthor: %aN %nDate:   " + dateFormat + " %nParents:%P %n%s\" " + LogParam);

            gitGetGraphCommand.DataReceived += new System.Diagnostics.DataReceivedEventHandler(gitGetGraphCommand_DataReceived);
            gitGetGraphCommand.Exited += new EventHandler(gitGetGraphCommand_Exited);
        }
开发者ID:rzeng,项目名称:gitextensions,代码行数:25,代码来源:RevisionGraph.cs

示例2: Execute

        public void Execute()
        {
            Revisions = new List<GitRevision>();

            heads = GitCommands.GetHeads(true);

            gitGetGraphCommand = new GitCommands();
            gitGetGraphCommand.CollectOutput = false;
            gitGetGraphCommand.CmdStartProcess(Settings.GitDir + "git.cmd", "log -n " + LimitRevisions + " --graph --all --pretty=format:\"Commit %H %nTree:   %T%nAuthor: %aN %nDate:   %cd %nParents:%P %n%s\"");

            gitGetGraphCommand.DataReceived += new System.Diagnostics.DataReceivedEventHandler(gitGetGraphCommand_DataReceived);
            gitGetGraphCommand.Exited += new EventHandler(gitGetGraphCommand_Exited);
        }
开发者ID:arBmind,项目名称:gitextensions,代码行数:13,代码来源:RevisionGraph.cs

示例3: Execute

        public void Execute()
        {
            Revisions = new List<GitRevision>();

            heads = GitCommands.GetHeads(true);

            if (!LogParam.Contains("=") && Settings.ShowRevisionGraph)
                LogParam = " --graph " + LogParam;

            if (Settings.OrderRevisionByDate)
                LogParam = " --date-order " + LogParam;

            string dateFormat;
            if (Settings.RelativeDate)
                dateFormat = "r";
            else
                dateFormat = "d";

            string limitRevisionsArgument;
            if (LogParam.Contains("--follow"))
                limitRevisionsArgument = "";
            else
                limitRevisionsArgument = " -n " + LimitRevisions;

            string arguments = String.Format(CultureInfo.InvariantCulture,
                "log{0} --pretty=format:\"Commit %H %nTree: %T %nAuthor: %aN %nAuthorDate: %a{1} %nCommitter: %cN %nCommitDate: %c{1} %nParents: %P %n%s\" {2}",
                limitRevisionsArgument,
                dateFormat,
                LogParam);

            gitGetGraphCommand = new GitCommands();
            gitGetGraphCommand.CollectOutput = false;
            gitGetGraphCommand.CmdStartProcess(Settings.GitCommand, arguments);

            gitGetGraphCommand.DataReceived += new System.Diagnostics.DataReceivedEventHandler(gitGetGraphCommand_DataReceived);
            gitGetGraphCommand.Exited += new EventHandler(gitGetGraphCommand_Exited);
        }
开发者ID:spidercat,项目名称:gitextensions,代码行数:37,代码来源:RevisionGraph.cs

示例4: execute

        private void execute()
        {
            lock (revisions)
            {
                revisions.Clear();
            }

            heads = GitCommands.GetHeads(true);

            string formatString =
                /* <COMMIT>       */ COMMIT_BEGIN + "%n" +
                /* Hash           */ "%H%n" +
                /* Parents        */ "%P%n";
            if (!ShaOnly)
            {
                formatString +=
                    /* Tree           */ "%T%n" +
                    /* Author Name    */ "%aN%n" +
                    /* Author Date    */ "%ai%n" +
                    /* Committer Name */ "%cN%n" +
                    /* Committer Date */ "%ci%n" +
                    /* Commit Message */ "%s";
            }

            // NOTE:
            // when called from FileHistory and FollowRenamesInFileHistory is enabled the "--name-only" argument is set.
            // the filename is the next line after the commit-format defined above.

            if (Settings.OrderRevisionByDate)
            {
                LogParam = " --date-order " + LogParam;
            }
            else
            {
                LogParam = " --topo-order " + LogParam;
            }

            string arguments = String.Format(CultureInfo.InvariantCulture,
                "log -z {2} --pretty=format:\"{1}\" {0}",
                LogParam,
                formatString,
                BranchFilter);

            gitGetGraphCommand = new GitCommands();
            gitGetGraphCommand.StreamOutput = true;
            gitGetGraphCommand.CollectOutput = false;
            Process p = gitGetGraphCommand.CmdStartProcess(Settings.GitCommand, arguments);

            string line;
            do
            {
                line = p.StandardOutput.ReadLine();

                if (line != null)
                {
                    foreach (string entry in line.Split('\0'))
                    {
                        dataReceived(entry);
                    }
                }
            } while (line != null);
            finishRevision();

            Exited(this, new EventArgs());
        }
开发者ID:meaney,项目名称:gitextensions,代码行数:65,代码来源:RevisionGraph.cs

示例5: LoadRevisions

        private void LoadRevisions()
        {
            if (RevisionList == null)
            {
                return;
            }

            if (RevisionList != null && (RevisionList.Count == 0 && string.IsNullOrEmpty(Filter)))
            {
                Loading.Visible = false;
                NoCommits.Visible = true;
                Revisions.Visible = false;
                return;
            }

            Revisions.SuspendLayout();
            Revisions.Columns[3].HeaderText = Settings.ShowAuthorDate ? "Author Date" : "Commit Date";

            if (!ScrollBarSet)
            {
                ScrollBarSet = true;
                Revisions.ScrollBars = ScrollBars.None;
                Revisions.RowCount = RevisionList.Count;
                Revisions.ScrollBars = ScrollBars.Vertical;

                if (RevisionList.Count >= GitCommands.Settings.MaxCommits)
                {
                    string grep = "";
                    if (!string.IsNullOrEmpty(Filter))
                        grep = " --grep=\"" + Filter + "\" ";

                    gitCountCommitsCommand = new GitCommands.GitCommands();
                    gitCountCommitsCommand.CmdStartProcess("cmd.exe", "/c \"\"" + Settings.GitCommand + "\" rev-list " + grep + LogParam + " | \"" + Settings.GitBinDir + "wc\" -l\"");
                    gitCountCommitsCommand.Exited += new EventHandler(gitCountCommitsCommand_Exited);
                }

            }

            Revisions.SelectionChanged -= new EventHandler(Revisions_SelectionChanged);

            if (LastScrollPos > 0 && Revisions.RowCount > LastScrollPos)
            {
                Revisions.FirstDisplayedScrollingRowIndex = LastScrollPos;
                LastScrollPos = -1;
            }

            if (LastSelectedRows.Count > 0)
            {
                Revisions.ClearSelection();

                if (Revisions.Rows.Count > LastSelectedRows[0])
                    Revisions.CurrentCell = Revisions.Rows[LastSelectedRows[0]].Cells[0];

                foreach (int row in LastSelectedRows)
                {
                    if (Revisions.Rows.Count > row)
                    {
                        Revisions.Rows[row].Selected = true;
                    }
                }
                LastSelectedRows.Clear();
            }

            DrawVisibleGraphPart();

            Loading.Visible = false;
            Revisions.Enabled = true;
            Revisions.Focus();
            Revisions.SelectionChanged += new EventHandler(Revisions_SelectionChanged);

            Revisions.ResumeLayout();

            if (initialLoad)
            {
                initialLoad = false;
                SelecctionTimer.Enabled = false;
                SelecctionTimer.Stop();
                SelecctionTimer.Enabled = true;
                SelecctionTimer.Start();
            }
        }
开发者ID:bszafko,项目名称:gitextensions,代码行数:81,代码来源:RevisionGrid.cs

示例6: UnstageFiles

        public static string UnstageFiles(List<GitItemStatus> files)
        {
            GitCommands gitCommand = new GitCommands();

            string output = "";

            Process process1 = null;
            foreach (GitItemStatus file in files)
            {
                if (!file.IsNew)
                {
                    if (process1 == null)
                        process1 = gitCommand.CmdStartProcess(Settings.GitCommand, "update-index --info-only --index-info");

                    process1.StandardInput.WriteLine("0 0000000000000000000000000000000000000000\t\"" + FixPath(file.Name) + "\"");
                }
            }
            if (process1 != null)
            {
                process1.StandardInput.Close();
                process1.WaitForExit();
            }

            if (gitCommand.Output != null)
                output = gitCommand.Output.ToString();

            Process process2 = null;
            foreach (GitItemStatus file in files)
            {
                if (file.IsNew)
                {
                    if (process2 == null)
                        process2 = gitCommand.CmdStartProcess(Settings.GitCommand, "update-index --force-remove --stdin");
                    process2.StandardInput.WriteLine("\"" + FixPath(file.Name) + "\"");
                }
            }
            if (process2 != null)
            {
                process2.StandardInput.Close();
                process2.WaitForExit();
            }

            if (gitCommand.Output != null)
                output += gitCommand.Output.ToString();

            return output;
        }
开发者ID:Gitulf,项目名称:gitextensions,代码行数:47,代码来源:GitCommands.cs

示例7: StageFiles

        public static string StageFiles(IList<GitItemStatus> files)
        {
            GitCommands gitCommand = new GitCommands();

            string output = "";

            Process process1 = null;
            foreach (GitItemStatus file in files)
            {
                if (!file.IsDeleted)
                {
                    if (process1 == null)
                        process1 = gitCommand.CmdStartProcess(Settings.GitCommand, "update-index --add --stdin");

                    process1.StandardInput.WriteLine("\"" + FixPath(file.Name) + "\"");
                }
            }
            if (process1 != null)
            {
                process1.StandardInput.Close();
                process1.WaitForExit();

                if (gitCommand.Output != null)
                    output = gitCommand.Output.ToString().Trim();
            }

            Process process2 = null;
            foreach (GitItemStatus file in files)
            {
                if (file.IsDeleted)
                {
                    if (process2 == null)
                        process2 = gitCommand.CmdStartProcess(Settings.GitCommand, "update-index --remove --stdin");
                    process2.StandardInput.WriteLine("\"" + FixPath(file.Name) + "\"");
                }
            }
            if (process2 != null)
            {
                process2.StandardInput.Close();
                process2.WaitForExit();

                if (gitCommand.Output != null)
                {
                    if (!string.IsNullOrEmpty(output))
                    {
                        output += Environment.NewLine;
                    }
                    output += gitCommand.Output.ToString().Trim();
                }
            }

            return output;
        }
开发者ID:Gitulf,项目名称:gitextensions,代码行数:53,代码来源:GitCommands.cs

示例8: execute

        private void execute()
        {
            lock (revisions)
            {
                revisions.Clear();
            }

            heads = GitCommands.GetHeads(true);

            string formatString =
                /* <COMMIT>       */ COMMIT_BEGIN + "%n" +
                /* Hash           */ "%H%n" +
                /* Parents        */ "%P%n";
            if (!ShaOnly)
            {
                formatString +=
                    /* Tree           */ "%T%n" +
                    /* Author Name    */ "%aN%n" +
                    /* Author Date    */ "%ai%n" +
                    /* Committer Name */ "%cN%n" +
                    /* Committer Date */ "%ci%n" +
                    /* Commit Message */ "%s";
            }

            if (Settings.OrderRevisionByDate)
            {
                LogParam = " --date-order " + LogParam;
            }
            else
            {
                LogParam = " --topo-order " + LogParam;
            }

            string arguments = String.Format(CultureInfo.InvariantCulture,
                "log {2} --pretty=format:\"{1}\" {0}",
                LogParam,
                formatString,
                BranchFilter);

            gitGetGraphCommand = new GitCommands();
            gitGetGraphCommand.StreamOutput = true;
            gitGetGraphCommand.CollectOutput = false;
            Process p = gitGetGraphCommand.CmdStartProcess(Settings.GitCommand, arguments);

            string line;
            do
            {
                line = p.StandardOutput.ReadLine();
                dataReceived(line);
            } while (line != null);

            Exited(this, new EventArgs());
        }
开发者ID:Gitulf,项目名称:gitextensions,代码行数:53,代码来源:RevisionGraph.cs

示例9: LoadRevisions

        private void LoadRevisions()
        {
            if (RevisionList == null)
            {
                return;
            }

            if (RevisionList != null && RevisionList.Count == 0)
            {
                Loading.Visible = false;
                NoCommits.Visible = true;
                Revisions.Visible = false;
                return;
            }

            if (!ScrollBarSet)
            {
                ScrollBarSet = true;
                Revisions.SuspendLayout();
                Revisions.ScrollBars = ScrollBars.None;
                Revisions.RowCount = RevisionList.Count;
                Revisions.ScrollBars = ScrollBars.Vertical;

                if (RevisionList.Count >= GitCommands.Settings.MaxCommits)
                {
                    gitCountCommitsCommand = new GitCommands.GitCommands();
                    gitCountCommitsCommand.CmdStartProcess(Settings.GitDir + "C:\\Windows\\System32\\cmd.exe", "/c \"git.cmd rev-list --all --abbrev-commit | wc -l\"");
                    gitCountCommitsCommand.Exited += new EventHandler(gitCountCommitsCommand_Exited);
                }
                Revisions.ResumeLayout();
            }

            Revisions.SelectionChanged -= new EventHandler(Revisions_SelectionChanged);

            DrawVisibleGraphPart();

            Loading.Visible = false;
            Revisions.Enabled = true;
            Revisions.Focus();
            Revisions.SelectionChanged += new EventHandler(Revisions_SelectionChanged);
        }
开发者ID:arBmind,项目名称:gitextensions,代码行数:41,代码来源:RevisionGrid.cs


注:本文中的GitCommands.GitCommands.CmdStartProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。