コード例 #1
0
        private void AADiffBaseVsSourceMI_Click(object sender, EventArgs e)
        {
            if ((sourceFile == null) || (!System.IO.File.Exists(sourceFile)))
            {
                sourceFile = new TempFile(_selectedItem.ResolveRecord.FromFileSpec);
                if (Scm.GetFileVersion(sourceFile, _selectedItem.ResolveRecord.FromFileSpec) == null)
                {
                    sourceFile.Dispose();
                    sourceFile = null;
                    return;
                }
            }

            if ((baseFile == null) || (!System.IO.File.Exists(baseFile)))
            {
                baseFile = new TempFile(_selectedItem.ResolveRecord.BaseFileSpec);
                if (Scm.GetFileVersion(baseFile, _selectedItem.ResolveRecord.BaseFileSpec) == null)
                {
                    baseFile.Dispose();
                    baseFile = null;
                    return;
                }
            }

            Scm.Diff2Files(baseFile,
                           string.Format(Resources.ResolveFileInteractiveControl_BaseFile,
                                         _selectedItem.ResolveRecord.BaseFileSpec),
                           sourceFile,
                           string.Format(Resources.ResolveFileInteractiveControl_SourceFile,
                                         _selectedItem.ResolveRecord.FromFileSpec)
                           );
        }
コード例 #2
0
        private void AADiffTargetVsMergedMI_Click(object sender, EventArgs e)
        {
            if ((sourceFile == null) || (!System.IO.File.Exists(sourceFile)))
            {
                sourceFile = new TempFile(_selectedItem.ResolveRecord.FromFileSpec);
                if (Scm.GetFileVersion(sourceFile, _selectedItem.ResolveRecord.FromFileSpec) == null)
                {
                    sourceFile.Dispose();
                    sourceFile = null;
                    return;
                }
            }

            if ((baseFile == null) || (!System.IO.File.Exists(baseFile)))
            {
                baseFile = new TempFile(_selectedItem.ResolveRecord.BaseFileSpec);
                if (Scm.GetFileVersion(baseFile, _selectedItem.ResolveRecord.BaseFileSpec) == null)
                {
                    baseFile.Dispose();
                    baseFile = null;
                    return;
                }
            }

            string targetFile = _selectedItem.ResolveRecord.LocalFilePath.Path;

            if ((mergedFile == null) || (!System.IO.File.Exists(mergedFile)))
            {
                string mergedFileName = string.Format("{0}(merged {1}[{2}]){3}",
                                                      System.IO.Path.GetFileNameWithoutExtension(_selectedItem.ResolveRecord.LocalFilePath.Path),
                                                      ((P4.VersionRange)_selectedItem.ResolveRecord.FromFileSpec.Version).Upper,
                                                      _selectedItem.ResolveRecord.BaseFileSpec.Version,
                                                      System.IO.Path.GetExtension(_selectedItem.ResolveRecord.LocalFilePath.Path));

                mergedFile = new TempFile(mergedFileName);

                if (Scm.MergeLocalFiles(baseFile, sourceFile, targetFile, mergedFile) == false)
                {
                    MessageBox.Show(Resources.ResolveFileInteractiveControl_CannotCreateMergedFile, Resources.PerforceSCM, MessageBoxButtons.OK);
                    mergedFile.Dispose();
                    mergedFile = null;
                    return;
                }
            }
            Scm.Diff2Files(targetFile,
                           string.Format(Resources.ResolveFileInteractiveControl_TargetFile,
                                         targetFile),
                           mergedFile,
                           Resources.ResolveFileInteractiveControl_MergedSourceTarget);
        }
コード例 #3
0
        private void AADiffBaseVsTargetMI_Click(object sender, EventArgs e)
        {
            if (baseFile == null)
            {
                baseFile = new TempFile();
                if (Scm.GetFileVersion(baseFile, _selectedItem.ResolveRecord.BaseFileSpec) == null)
                {
                    return;
                }
            }

            string targetFile = _selectedItem.ResolveRecord.LocalFilePath.Path;

            Scm.Diff2Files(baseFile,
                           string.Format(Resources.ResolveFileInteractiveControl_SourceFile,
                                         _selectedItem.ResolveRecord.BaseFileSpec),
                           targetFile,
                           string.Format(Resources.ResolveFileInteractiveControl_TargetFile,
                                         targetFile)
                           );
        }
コード例 #4
0
        private void AADiffSourceVsTargetMI_Click(object sender, EventArgs e)
        {
            if ((sourceFile == null) || (!System.IO.File.Exists(sourceFile)))
            {
                sourceFile = new TempFile(_selectedItem.ResolveRecord.FromFileSpec);
                if (Scm.GetFileVersion(sourceFile, _selectedItem.ResolveRecord.FromFileSpec) == null)
                {
                    sourceFile.Dispose();
                    sourceFile = null;
                    return;
                }
            }
            string targetFile = _selectedItem.ResolveRecord.LocalFilePath.Path;

            Scm.Diff2Files(sourceFile,
                           string.Format(Resources.ResolveFileInteractiveControl_SourceFile,
                                         _selectedItem.ResolveRecord.FromFileSpec),
                           targetFile,
                           string.Format(Resources.ResolveFileInteractiveControl_TargetFile,
                                         targetFile)
                           );
        }
コード例 #5
0
        private void AADiffSourceVsMergedMI_Click(object sender, EventArgs e)
        {
            if (sourceFile == null)
            {
                sourceFile = new TempFile();
                if (Scm.GetFileVersion(sourceFile, _selectedItem.ResolveRecord.FromFileSpec) == null)
                {
                    return;
                }
            }

            if (baseFile == null)
            {
                baseFile = new TempFile();
                if (Scm.GetFileVersion(baseFile, _selectedItem.ResolveRecord.BaseFileSpec) == null)
                {
                    return;
                }
            }

            string targetFile = _selectedItem.ResolveRecord.LocalFilePath.Path;

            if (mergedFile == null)
            {
                mergedFile = new TempFile();

                if (Scm.MergeLocalFiles(baseFile, sourceFile, targetFile, mergedFile) == false)
                {
                    return;
                }
            }
            Scm.Diff2Files(sourceFile,
                           string.Format(Resources.ResolveFileInteractiveControl_SourceFile,
                                         _selectedItem.ResolveRecord.FromFileSpec),
                           mergedFile,
                           "Merged Source/Target");
        }