Ejemplo n.º 1
0
        private P4.P4ClientMerge.MergeStatus MergeCallBackHandler(P4.FileResolveRecord resolveRecord,
                                                                  P4.Client.AutoResolveDelegate AutoResolve, string sourcePath, string targetPath, string basePath, string resultsPath)
        {
            if (ResolveResult == P4.P4ClientMerge.MergeStatus.CMS_EDIT)
            {
                if (resolveRecord.Analysis.ResolveType == P4.ResolveType.Content)
                {
                    while (true)
                    {
                        Scm.MergeFiles(
                            sourcePath, _selectedItem.ResolveRecord.FromFileSpec.ToString(),
                            targetPath, _selectedItem.ResolveRecord.LocalFilePath.ToString(),
                            basePath, _selectedItem.ResolveRecord.BaseFileSpec.ToString(),
                            resultsPath);

                        DialogResult answer = MessageBox.Show(Resources.ResolveFileInteractiveControl_ResolveSaveChanges, Resources.PerforceSCM, MessageBoxButtons.YesNoCancel);

                        if (answer == DialogResult.Cancel)
                        {
                            // user wants to cancel
                            return(P4.P4ClientMerge.MergeStatus.CMS_SKIP);
                        }
                        if (answer == DialogResult.No)
                        {
                            // user wants to try again
                            continue;
                        }
                        // user wants to keep merged file
                        return(P4.P4ClientMerge.MergeStatus.CMS_MERGED);
                    }
                }
            }
            return(ResolveResult);
        }