From baef820354ae49f057582566a200a35819560c90 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Sun, 12 Jul 2009 13:34:42 +0800 Subject: [PATCH] Fixed issue #111: Undo Add does not work (keep added file) and enable "F5" at revert dialog Signed-off-by: Frank Li --- src/Git/Git.cpp | 3 ++- src/TortoiseProc/Commands/RevertCommand.cpp | 2 ++ src/TortoiseProc/RevertDlg.cpp | 2 ++ src/TortoiseProc/SVNProgressDlg.cpp | 8 ++++---- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 35c5a65..864684b 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -1117,7 +1117,8 @@ int CGit::Revert(CTGitPath &path,bool keep) CString cmd, out; if(path.m_Action & CTGitPath::LOGACTIONS_ADDED) { //To init git repository, there are not HEAD, so we can use git reset command - cmd.Format(_T("git.exe rm --cache -- \"%s\""),path.GetGitPathString()); + cmd.Format(_T("git.exe rm --cached \"%s\""),path.GetGitPathString()); + if(g_Git.Run(cmd,&out,CP_ACP)) return -1; } diff --git a/src/TortoiseProc/Commands/RevertCommand.cpp b/src/TortoiseProc/Commands/RevertCommand.cpp index 53dabdc..1b0dd70 100644 --- a/src/TortoiseProc/Commands/RevertCommand.cpp +++ b/src/TortoiseProc/Commands/RevertCommand.cpp @@ -29,6 +29,8 @@ bool RevertCommand::Execute() dlg.m_pathList = pathList; if (dlg.DoModal() == IDOK) { + +// g_Git.Revert(dlg.m_selectedPathList,true); CGitProgressDlg progDlg; theApp.m_pMainWnd = &progDlg; diff --git a/src/TortoiseProc/RevertDlg.cpp b/src/TortoiseProc/RevertDlg.cpp index b37d254..aabb408 100644 --- a/src/TortoiseProc/RevertDlg.cpp +++ b/src/TortoiseProc/RevertDlg.cpp @@ -108,6 +108,8 @@ UINT CRevertDlg::RevertThread() DialogEnableWindow(IDOK, false); m_bCancelled = false; + m_RevertList.Clear(); + if (!m_RevertList.GetStatus(&m_pathList)) { m_RevertList.SetEmptyString(m_RevertList.GetLastErrorMessage()); diff --git a/src/TortoiseProc/SVNProgressDlg.cpp b/src/TortoiseProc/SVNProgressDlg.cpp index 88b6542..fb5eef1 100644 --- a/src/TortoiseProc/SVNProgressDlg.cpp +++ b/src/TortoiseProc/SVNProgressDlg.cpp @@ -2465,9 +2465,9 @@ bool CGitProgressDlg::CmdRevert(CString& sWindowTitle, bool& localoperation) SetWindowText(sWindowTitle); SetBackgroundImage(IDI_REVERT_BKG); - CTGitPathList delList = m_selectedPaths; - if (DWORD(CRegDWORD(_T("Software\\TortoiseGit\\RevertWithRecycleBin"), TRUE))) - delList.DeleteAllFiles(true); + //CTGitPathList delList = m_selectedPaths; + //if (DWORD(CRegDWORD(_T("Software\\TortoiseGit\\RevertWithRecycleBin"), TRUE))) + // delList.DeleteAllFiles(true); ReportCmd(CString(MAKEINTRESOURCE(IDS_PROGRS_CMD_REVERT))); for(int i=0;i