From 208f0143d3299b1b617737502d49488c4c5683e1 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Fri, 10 Jul 2009 13:38:17 +0800 Subject: [PATCH] Fix Issue #111: Undo Add does not work Signed-off-by: Frank Li --- src/TortoiseProc/Commands/RevertCommand.cpp | 21 ++++----------------- src/TortoiseProc/SVNProgressDlg.cpp | 24 ++++++++++++++++-------- src/TortoiseProc/SVNProgressDlg.h | 1 + 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/TortoiseProc/Commands/RevertCommand.cpp b/src/TortoiseProc/Commands/RevertCommand.cpp index 32827c7..53dabdc 100644 --- a/src/TortoiseProc/Commands/RevertCommand.cpp +++ b/src/TortoiseProc/Commands/RevertCommand.cpp @@ -20,7 +20,7 @@ #include "RevertCommand.h" #include "RevertDlg.h" -//#include "SVNProgressDlg.h" +#include "SVNProgressDlg.h" #include "MessageBox.h" bool RevertCommand::Execute() @@ -30,22 +30,9 @@ bool RevertCommand::Execute() if (dlg.DoModal() == IDOK) { - if (dlg.m_selectedPathList.GetCount() == 0) - return FALSE; - CString cmd; - CString out; - for(int i=0;i< dlg.m_selectedPathList.GetCount() ;i++) - { - cmd.Format(_T("git.exe checkout -f -- \"%s\""),dlg.m_selectedPathList[i].GetGitPathString()); - if(g_Git.Run(cmd,&out,CP_ACP)) - { - CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK); - } - } -#if 0 - CSVNProgressDlg progDlg; + CGitProgressDlg progDlg; theApp.m_pMainWnd = &progDlg; - progDlg.SetCommand(CSVNProgressDlg::SVNProgress_Revert); + progDlg.SetCommand(CGitProgressDlg::GitProgress_Revert); if (parser.HasVal(_T("closeonend"))) progDlg.SetAutoClose(parser.GetLongVal(_T("closeonend"))); progDlg.SetOptions(dlg.m_bRecursive ? ProgOptRecursive : ProgOptNonRecursive); @@ -53,7 +40,7 @@ bool RevertCommand::Execute() progDlg.SetItemCount(dlg.m_selectedPathList.GetCount()); progDlg.SetSelectedList(dlg.m_selectedPathList); progDlg.DoModal(); -#endif + return true; } return false; diff --git a/src/TortoiseProc/SVNProgressDlg.cpp b/src/TortoiseProc/SVNProgressDlg.cpp index 08b16bc..88b6542 100644 --- a/src/TortoiseProc/SVNProgressDlg.cpp +++ b/src/TortoiseProc/SVNProgressDlg.cpp @@ -306,6 +306,10 @@ BOOL CGitProgressDlg::Notify(const CTGitPath& path, git_wc_notify_action_t actio data->sActionColumnText.LoadString(IDS_SVNACTION_RESOLVE); break; + case git_wc_notify_revert: + data->sActionColumnText.LoadString(IDS_SVNACTION_REVERT); + break; + #if 0 case svn_wc_notify_commit_added: data->sActionColumnText.LoadString(IDS_SVNACTION_ADDING); @@ -331,9 +335,7 @@ BOOL CGitProgressDlg::Notify(const CTGitPath& path, git_wc_notify_action_t actio case svn_wc_notify_restore: data->sActionColumnText.LoadString(IDS_SVNACTION_RESTORE); break; - case svn_wc_notify_revert: - data->sActionColumnText.LoadString(IDS_SVNACTION_REVERT); - break; + case svn_wc_notify_update_replace: case svn_wc_notify_commit_replaced: data->sActionColumnText.LoadString(IDS_SVNACTION_REPLACED); @@ -2457,7 +2459,7 @@ bool CGitProgressDlg::CmdResolve(CString& sWindowTitle, bool& localoperation) bool CGitProgressDlg::CmdRevert(CString& sWindowTitle, bool& localoperation) { -#if 0 + localoperation = true; sWindowTitle.LoadString(IDS_PROGRS_TITLE_REVERT); SetWindowText(sWindowTitle); @@ -2468,13 +2470,19 @@ bool CGitProgressDlg::CmdRevert(CString& sWindowTitle, bool& localoperation) delList.DeleteAllFiles(true); ReportCmd(CString(MAKEINTRESOURCE(IDS_PROGRS_CMD_REVERT))); - if (!Revert(m_targetPathList, CStringArray(), !!(m_options & ProgOptRecursive))) + for(int i=0;i