コード例 #1
0
        public ConvertedArguments Convert(DiffToolArguments arguments)
        {
            string baseSha = arguments.LeftSHA;
            string headSha = arguments.RightSHA;

            throwOnEmptySha(new[] { baseSha, headSha });

            FileStorageDiffCacheFolder diffFolder = getDiffFolder(baseSha, headSha);

            Debug.Assert(diffFolder != null);

            var configValue = GitTools.GetConfigKeyValue(GitTools.ConfigScope.Global, Constants.GitDiffToolConfigKey);

            if (String.IsNullOrEmpty(configValue.FirstOrDefault()))
            {
                throw new ArgumentConversionException("Diff Tool is not registered", null);
            }

            string diffToolPath = configValue.FirstOrDefault()
                                  .Replace("$LOCAL", diffFolder.LeftSubfolder)
                                  .Replace("$REMOTE", diffFolder.RightSubfolder)
                                  .Replace("//", "/");

            return(new ConvertedArguments(diffToolPath, String.Empty));
        }
コード例 #2
0
 public int LaunchDiffTool(DiffToolArguments arguments)
 {
     try
     {
         return((int)runCommand(arguments));
     }
     catch (GitCommandServiceInternalException ex)
     {
         ExceptionHandlers.Handle(ex.Message, ex);
         throw new DiffToolLaunchException(ex);
     }
 }
コード例 #3
0
 protected override object runCommand(DiffToolArguments arguments)
 {
     try
     {
         ConvertedArguments converted = _argumentConverter.Convert(arguments);
         return(startExternalProcess(converted.App, converted.Arguments, _path, false, null).PID);
     }
     catch (ArgumentConversionException ex)
     {
         throw new GitCommandServiceInternalException(ex);
     }
 }
コード例 #4
0
 abstract protected object runCommand(DiffToolArguments arguments);
コード例 #5
0
 protected override object runCommand(DiffToolArguments arguments)
 {
     return(startExternalProcess("git", arguments.ToString(), _path, false, null).PID);
 }