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


C# SparkleGit.StartAndReadStandardError方法代码示例

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


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

示例1: Rebase

        // Merges the fetched changes
        private void Rebase()
        {
            if (HasLocalChanges) {
                Add ();

                string commit_message = FormatCommitMessage ();
                Commit (commit_message);
            }

            // Temporarily change the ignorecase setting to true to avoid
            // conflicts in file names due to case changes
            SparkleGit git = new SparkleGit (LocalPath, "config core.ignorecase true");
            git.StartAndWaitForExit ();

            git = new SparkleGit (LocalPath, "rebase FETCH_HEAD");
            git.StartInfo.RedirectStandardOutput = false;

            string error_output = git.StartAndReadStandardError ();

            if (git.ExitCode != 0) {
                SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out...");

                // error: cannot stat 'filename': Permission denied
                if (SparkleBackend.Platform != PlatformID.Unix &&
                    error_output.Contains ("error: cannot stat")) {

                    // TODO
                }

                while (HasLocalChanges) {
                    try {
                        ResolveConflict ();

                    } catch (IOException e) {
                        SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again... (" + e.Message + ")");
                    }
                }

                SparkleLogger.LogInfo ("Git", Name + " | Conflict resolved");
                OnConflictResolved ();
            }

            git = new SparkleGit (LocalPath, "config core.ignorecase false");
            git.StartAndWaitForExit ();
        }
开发者ID:zubryan,项目名称:SparkleShare,代码行数:46,代码来源:SparkleRepoGit.cs

示例2: Rebase

        // Merges the fetched changes
        private bool Rebase()
        {
            if (HasLocalChanges) {
                Add ();

                string commit_message = FormatCommitMessage ();
                Commit (commit_message);
            }

            // Temporarily change the ignorecase setting to true to avoid
            // conflicts in file names due to case changes
            SparkleGit git = new SparkleGit (LocalPath, "config core.ignorecase true");
            git.StartAndWaitForExit ();

            git = new SparkleGit (LocalPath, "rebase FETCH_HEAD");
            git.StartInfo.RedirectStandardOutput = false;

            string error_output = git.StartAndReadStandardError ();

            if (git.ExitCode != 0) {
                // Stop when we can't rebase due to locked local files
                // error: cannot stat 'filename': Permission denied
                if (error_output.Contains ("error: cannot stat")) {
                    Error = ErrorStatus.LockedFiles;
                    SparkleLogger.LogInfo ("Git", Name + " | Error status changed to " + Error);

                    git = new SparkleGit (LocalPath, "rebase --abort");
                    git.StartAndWaitForExit ();

                    git = new SparkleGit (LocalPath, "config core.ignorecase false");
                    git.StartAndWaitForExit ();

                    return false;

                } else {
                    SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out...");
                    string rebase_apply_path = new string [] { LocalPath, ".git", "rebase-apply" }.Combine ();

                    while (Directory.Exists (rebase_apply_path) && HasLocalChanges) {
                        try {
                            ResolveConflict ();

                        } catch (IOException e) {
                            SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again...", e);
                        }
                    }

                    SparkleLogger.LogInfo ("Git", Name + " | Conflict resolved");
                    OnConflictResolved ();
                }
            }

            git = new SparkleGit (LocalPath, "config core.ignorecase false");
            git.StartAndWaitForExit ();

            return true;
        }
开发者ID:cnzzr,项目名称:SparkleShare,代码行数:58,代码来源:SparkleRepoGit.cs

示例3: Merge

        // Merges the fetched changes
        private bool Merge()
        {
            string message = FormatCommitMessage ();

            if (message != null) {
                Add ();
                Commit (message);
            }

            SparkleGit git;

            // Stop if we're already in a merge because something went wrong
            if (this.in_merge) {
                 git = new SparkleGit (LocalPath, "merge --abort");
                 git.StartAndWaitForExit ();

                 return false;
            }

            // Temporarily change the ignorecase setting to true to avoid
            // conflicts in file names due to letter case changes
            git = new SparkleGit (LocalPath, "config core.ignorecase true");
            git.StartAndWaitForExit ();

            git = new SparkleGit (LocalPath, "merge FETCH_HEAD");
            git.StartInfo.RedirectStandardOutput = false;

            string error_output = git.StartAndReadStandardError ();

            if (git.ExitCode != 0) {
                // Stop when we can't merge due to locked local files
                // error: cannot stat 'filename': Permission denied
                if (error_output.Contains ("error: cannot stat")) {
                    Error = ErrorStatus.UnreadableFiles;
                    SparkleLogger.LogInfo ("Git", Name + " | Error status changed to " + Error);

                    git = new SparkleGit (LocalPath, "merge --abort");
                    git.StartAndWaitForExit ();

                    git = new SparkleGit (LocalPath, "config core.ignorecase false");
                    git.StartAndWaitForExit ();

                    return false;

                } else {
                    SparkleLogger.LogInfo ("Git", error_output);
                    SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out...");

                    while (this.in_merge && HasLocalChanges) {
                        try {
                            ResolveConflict ();

                        } catch (IOException e) {
                            SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again...", e);
                        }
                    }

                    SparkleLogger.LogInfo ("Git", Name + " | Conflict resolved");
                }
            }

            git = new SparkleGit (LocalPath, "config core.ignorecase false");
            git.StartAndWaitForExit ();

            return true;
        }
开发者ID:richard-chivers,项目名称:SparkleShare,代码行数:67,代码来源:SparkleRepoGit.cs


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