private static bool FilterSyncOutput(PerforceOutputLine Line, PerforceTagRecordParser Parser, List <string> TamperedFiles, TextWriter Log) { if (Line.Channel == PerforceOutputChannel.TaggedInfo) { Parser.OutputLine(Line.Text); return(true); } Log.WriteLine(Line.Text); const string Prefix = "Can't clobber writable file "; if (Line.Channel == PerforceOutputChannel.Error && Line.Text.StartsWith(Prefix)) { TamperedFiles.Add(Line.Text.Substring(Prefix.Length).Trim()); return(true); } return(Line.Channel != PerforceOutputChannel.Error); }
private bool ParseCommandOutput(string Text, HandleOutputDelegate HandleOutput, CommandOptions Options) { if (Options.HasFlag(CommandOptions.NoChannels)) { PerforceOutputLine Line = new PerforceOutputLine(PerforceOutputChannel.Unknown, Text); return(HandleOutput(Line)); } else if (!IgnoreCommandOutput(Text, Options)) { PerforceOutputLine Line; if (Text.StartsWith("text: ")) { Line = new PerforceOutputLine(PerforceOutputChannel.Text, Text.Substring(6)); } else if (Text.StartsWith("info: ")) { Line = new PerforceOutputLine(PerforceOutputChannel.Info, Text.Substring(6)); } else if (Text.StartsWith("info1: ")) { Line = new PerforceOutputLine(IsValidTag(Text, 7)? PerforceOutputChannel.TaggedInfo : PerforceOutputChannel.Info, Text.Substring(7)); } else if (Text.StartsWith("warning: ")) { Line = new PerforceOutputLine(PerforceOutputChannel.Warning, Text.Substring(9)); } else if (Text.StartsWith("error: ")) { Line = new PerforceOutputLine(PerforceOutputChannel.Error, Text.Substring(7)); } else { Line = new PerforceOutputLine(PerforceOutputChannel.Unknown, Text); } return(HandleOutput(Line) && (Line.Channel != PerforceOutputChannel.Error || Options.HasFlag(CommandOptions.NoFailOnErrors)) && Line.Channel != PerforceOutputChannel.Unknown); } return(true); }
private static bool FilterSyncOutput(PerforceOutputLine Line, PerforceTagRecordParser Parser, List<string> TamperedFiles, TextWriter Log) { if(Line.Channel == PerforceOutputChannel.TaggedInfo) { Parser.OutputLine(Line.Text); return true; } Log.WriteLine(Line.Text); const string Prefix = "Can't clobber writable file "; if(Line.Channel == PerforceOutputChannel.Error && Line.Text.StartsWith(Prefix)) { TamperedFiles.Add(Line.Text.Substring(Prefix.Length).Trim()); return true; } return Line.Channel != PerforceOutputChannel.Error; }
private bool ParseCommandOutput(string Text, HandleOutputDelegate HandleOutput, CommandOptions Options) { if(Options.HasFlag(CommandOptions.NoChannels)) { PerforceOutputLine Line = new PerforceOutputLine(PerforceOutputChannel.Unknown, Text); return HandleOutput(Line); } else if(!IgnoreCommandOutput(Text, Options)) { PerforceOutputLine Line; if(Text.StartsWith("text: ")) { Line = new PerforceOutputLine(PerforceOutputChannel.Text, Text.Substring(6)); } else if(Text.StartsWith("info: ")) { Line = new PerforceOutputLine(PerforceOutputChannel.Info, Text.Substring(6)); } else if(Text.StartsWith("info1: ")) { Line = new PerforceOutputLine(IsValidTag(Text, 7)? PerforceOutputChannel.TaggedInfo : PerforceOutputChannel.Info, Text.Substring(7)); } else if(Text.StartsWith("warning: ")) { Line = new PerforceOutputLine(PerforceOutputChannel.Warning, Text.Substring(9)); } else if(Text.StartsWith("error: ")) { Line = new PerforceOutputLine(PerforceOutputChannel.Error, Text.Substring(7)); } else { Line = new PerforceOutputLine(PerforceOutputChannel.Unknown, Text); } return HandleOutput(Line) && (Line.Channel != PerforceOutputChannel.Error || Options.HasFlag(CommandOptions.NoFailOnErrors)) && Line.Channel != PerforceOutputChannel.Unknown; } return true; }