From 754011d8d8bdde0b2ad65bed46fbe399d882fb55 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 25 Mar 2012 17:27:44 +0200 Subject: [PATCH] fixed adding of a new file using a patch Signed-off-by: Sven Strickroth --- src/TortoiseMerge/FilePatchesDlg.cpp | 5 +++-- src/TortoiseMerge/MainFrm.cpp | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/TortoiseMerge/FilePatchesDlg.cpp b/src/TortoiseMerge/FilePatchesDlg.cpp index ffb62ae4a..749ef9e45 100644 --- a/src/TortoiseMerge/FilePatchesDlg.cpp +++ b/src/TortoiseMerge/FilePatchesDlg.cpp @@ -1,6 +1,7 @@ // TortoiseMerge - a Diff/Patch program // Copyright (C) 2006, 2008, 2010-2011 - TortoiseSVN +// Copyright (C) 2012 - Sven Strickroth // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -480,7 +481,7 @@ void CFilePatchesDlg::PatchAll() if (m_arFileStates.GetAt(i)!= FPDLG_FILESTATE_PATCHED) { progDlg.SetLine(2, GetFullPath(i), true); - m_pCallBack->PatchFile(GetFullPath(i), m_pPatch->GetRevision(i), TRUE); + m_pCallBack->PatchFile(GetFullPath(i), m_pPatch->GetRevision(i), TRUE, FALSE, &m_pPatch->GetFilename2(i)); } progDlg.SetProgress64(i, m_arFileStates.GetCount()); } @@ -510,7 +511,7 @@ void CFilePatchesDlg::PatchSelected() if (m_arFileStates.GetAt(index)!= FPDLG_FILESTATE_PATCHED) { progDlg.SetLine(2, GetFullPath(index), true); - m_pCallBack->PatchFile(GetFullPath(index), m_pPatch->GetRevision(index), TRUE); + m_pCallBack->PatchFile(GetFullPath(index), m_pPatch->GetRevision(index), TRUE, FALSE, &m_pPatch->GetFilename2(i)); } progDlg.SetProgress64(count++, selCount); } diff --git a/src/TortoiseMerge/MainFrm.cpp b/src/TortoiseMerge/MainFrm.cpp index 5cf78c806..eae6f4600 100644 --- a/src/TortoiseMerge/MainFrm.cpp +++ b/src/TortoiseMerge/MainFrm.cpp @@ -506,13 +506,16 @@ BOOL CMainFrame::PatchFile(CString sFilePath, CString sVersion, BOOL bAutoPatch, if( Path2) { temp.Format(_T("%s %s"), (LPCTSTR)CPathUtils::GetFileNameFromPath(*Path2), (LPCTSTR)m_Data.m_sPatchPatched); + m_Data.m_mergedFile.SetFileName(*Path2); } else + { temp.Format(_T("%s %s"), (LPCTSTR)CPathUtils::GetFileNameFromPath(sFilePath), (LPCTSTR)m_Data.m_sPatchPatched); + m_Data.m_mergedFile.SetFileName(sFilePath); + } m_Data.m_yourFile.SetDescriptiveName(temp); m_Data.m_theirFile.SetOutOfUse(); - m_Data.m_mergedFile.SetFileName(sFilePath); } TRACE(_T("comparing %s\nwith the patched result %s\n"), (LPCTSTR)sFilePath, (LPCTSTR)sTempFile); } -- 2.11.4.GIT