From 4b339cd428a2cd78f6fcfd806c4da3946d5e89c0 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Thu, 5 Feb 2009 14:21:41 +0800 Subject: [PATCH] Using GitProcessBar to show add process! Signed-off-by: Frank Li --- src/Resources/TortoiseProcENG.rc | Bin 403148 -> 403162 bytes src/TortoiseProc/Commands/AddCommand.cpp | 16 ++- src/TortoiseProc/LogFile.cpp | 4 +- src/TortoiseProc/LogFile.h | 2 +- src/TortoiseProc/SVNProgressDlg.cpp | 229 +++++++++++++++++++++---------- src/TortoiseProc/SVNProgressDlg.h | 21 ++- src/TortoiseProc/TortoiseProc.vcproj | 40 ++++-- src/Utils/SoundUtils.cpp | 39 +++--- src/Utils/SoundUtils.h | 10 +- src/Utils/Utils.vcproj | 52 ++++--- 10 files changed, 263 insertions(+), 150 deletions(-) diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index 90a61f05cf179e9da45a9b8aefaabcdbe0f36d6c..3c1fb480a7e71d00475bda485fa21c04ddd72045 100644 GIT binary patch delta 653 zcmZuvODIH97(Une?={9v*W@u}Fe^!6Qbg+Jwbm?!h0K*lM8+#gh=j7a#^+#@7+asIyV`@jFu--(=gug<)dVVHq)zuD5P?9LnS7n~@# zz5+gceUUuo+P;SMR8nRmr4oM$EK*AKE!)JjTY4&SDT?b8bQOp5Wl;>4P5vUf*VnEV?fj=kTnS>iK2Xb4kAJd&V%~ZyLAD4b~A-doA8_< z(AW}m%M~HgOAOLRiby+0y*zdcX6rqqnDp^Cz;VBbog~b&?WB_oAbXaxSzr}X(#2GD zM)qOLHZ0mK$xjA_HH^7Oau)OMK(vr2em?`#VsM-(7P)$ZhGc=tsXSCE(4H7# Ha>~RfdFt{- delta 560 zcmcb0R^rTAi47?!ticRn41SX@y2);COZjsF!kxZwHjC`^Z(kUNCNJ14Fx`)tk*)oV zDI*XwZ9ikmY_}SsY&-u$=F^N&Ef1eC8%`H^%xnbZJ3e4Bo?i8s*#KGo0YV&oW)_1G5%XCu26N`u3I&%npJOf$b+5Su`D?lJ+hvmfH=SS-7BH z+zu3YDh8DlWM&cFZWql`!vPgIc$HavdOpath = path; data->action = action; + data->sPathColumnText=path.GetGitPathString(); +#if 0 data->kind = kind; data->mime_type = mime_type; data->content_state = content_state; @@ -238,24 +248,26 @@ BOOL CGitProgressDlg::Notify(const CTSVNPath& path, svn_wc_notify_action_t actio data->basepath = m_basePath; if (range) data->merge_range = *range; +#endif switch (data->action) { - case svn_wc_notify_add: - case svn_wc_notify_update_add: - if ((data->content_state == svn_wc_notify_state_conflicted) || (data->prop_state == svn_wc_notify_state_conflicted)) - { - data->color = m_Colors.GetColor(CColors::Conflict); - data->bConflictedActionItem = true; - data->sActionColumnText.LoadString(IDS_SVNACTION_CONFLICTED); - m_nConflicts++; - } - else - { - m_bMergesAddsDeletesOccurred = true; + case git_wc_notify_add: + //case svn_wc_notify_update_add: + // if ((data->content_state == svn_wc_notify_state_conflicted) || (data->prop_state == svn_wc_notify_state_conflicted)) + // { + // data->color = m_Colors.GetColor(CColors::Conflict); + // data->bConflictedActionItem = true; + // data->sActionColumnText.LoadString(IDS_SVNACTION_CONFLICTED); + // m_nConflicts++; + // } + // else + // { + // m_bMergesAddsDeletesOccurred = true; data->sActionColumnText.LoadString(IDS_SVNACTION_ADD); data->color = m_Colors.GetColor(CColors::Added); - } + // } break; +#if 0 case svn_wc_notify_commit_added: data->sActionColumnText.LoadString(IDS_SVNACTION_ADDING); data->color = m_Colors.GetColor(CColors::Added); @@ -461,6 +473,7 @@ BOOL CGitProgressDlg::Notify(const CTSVNPath& path, svn_wc_notify_action_t actio data->sActionColumnText.Format(IDS_SVNACTION_MERGEBEGINMULTIPLEREVERSE, data->merge_range.start, data->merge_range.end + 1); data->bAuxItem = true; break; +#endif default: break; } // switch (data->action) @@ -473,7 +486,7 @@ BOOL CGitProgressDlg::Notify(const CTSVNPath& path, svn_wc_notify_action_t actio { m_arData.push_back(data); AddItemToList(); - if ((!data->bAuxItem)&&(m_itemCount > 0)) + if (/*(!data->bAuxItem)&&*/(m_itemCount > 0)) { m_itemCount--; @@ -483,19 +496,22 @@ BOOL CGitProgressDlg::Notify(const CTSVNPath& path, svn_wc_notify_action_t actio progControl->SetRange32(0, m_itemCountTotal); } } - if ((action == svn_wc_notify_commit_postfix_txdelta)&&(bSecondResized == FALSE)) - { - ResizeColumns(); - bSecondResized = TRUE; - } + //if ((action == svn_wc_notify_commit_postfix_txdelta)&&(bSecondResized == FALSE)) + //{ + // ResizeColumns(); + // bSecondResized = TRUE; + //} } return TRUE; } + CString CGitProgressDlg::BuildInfoString() { CString infotext; +#if 0 + CString temp; int added = 0; int copied = 0; @@ -632,10 +648,11 @@ CString CGitProgressDlg::BuildInfoString() infotext += temp; infotext.AppendFormat(_T(":%d "), resolved); } +#endif return infotext; } -void CGitProgressDlg::SetSelectedList(const CTSVNPathList& selPaths) +void CGitProgressDlg::SetSelectedList(const CTGitPathList& selPaths) { m_selectedPaths = selPaths; } @@ -728,7 +745,7 @@ BOOL CGitProgressDlg::OnInitDialog() AddAnchor(IDCANCEL, BOTTOM_RIGHT); AddAnchor(IDOK, BOTTOM_RIGHT); AddAnchor(IDC_LOGBUTTON, BOTTOM_RIGHT); - SetPromptParentWindow(this->m_hWnd); + //SetPromptParentWindow(this->m_hWnd); if (hWndExplorer) CenterWindow(CWnd::FromHandle(hWndExplorer)); EnableSaveRestore(_T("SVNProgressDlg")); @@ -740,27 +757,29 @@ bool CGitProgressDlg::SetBackgroundImage(UINT nID) return CAppUtils::SetListCtrlBackgroundImage(m_ProgList.GetSafeHwnd(), nID); } +#if 0 void CGitProgressDlg::ReportSVNError() { ReportError(GetLastErrorMessage()); } +#endif void CGitProgressDlg::ReportError(const CString& sError) { - CSoundUtils::PlayTSVNError(); + CSoundUtils::PlayTGitError(); ReportString(sError, CString(MAKEINTRESOURCE(IDS_ERR_ERROR)), m_Colors.GetColor(CColors::Conflict)); m_bErrorsOccurred = true; } void CGitProgressDlg::ReportWarning(const CString& sWarning) { - CSoundUtils::PlayTSVNWarning(); + CSoundUtils::PlayTGitWarning(); ReportString(sWarning, CString(MAKEINTRESOURCE(IDS_WARN_WARNING)), m_Colors.GetColor(CColors::Conflict)); } void CGitProgressDlg::ReportNotification(const CString& sNotification) { - CSoundUtils::PlayTSVNNotification(); + CSoundUtils::PlayTGitNotification(); ReportString(sNotification, CString(MAKEINTRESOURCE(IDS_WARN_NOTE))); } @@ -817,7 +836,7 @@ UINT CGitProgressDlg::ProgressThread() DialogEnableWindow(IDOK, FALSE); DialogEnableWindow(IDCANCEL, TRUE); - SetAndClearProgressInfo(m_hWnd); +// SetAndClearProgressInfo(m_hWnd); m_itemCount = m_itemCountTotal; InterlockedExchange(&m_bThreadRunning, TRUE); @@ -827,52 +846,52 @@ UINT CGitProgressDlg::ProgressThread() CTime startTime = CTime::GetCurrentTime(); switch (m_Command) { - case SVNProgress_Add: + case GitProgress_Add: bSuccess = CmdAdd(sWindowTitle, localoperation); break; - case SVNProgress_Checkout: + case GitProgress_Checkout: bSuccess = CmdCheckout(sWindowTitle, localoperation); break; - case SVNProgress_Commit: + case GitProgress_Commit: bSuccess = CmdCommit(sWindowTitle, localoperation); break; - case SVNProgress_Copy: + case GitProgress_Copy: bSuccess = CmdCopy(sWindowTitle, localoperation); break; - case SVNProgress_Export: + case GitProgress_Export: bSuccess = CmdExport(sWindowTitle, localoperation); break; - case SVNProgress_Import: + case GitProgress_Import: bSuccess = CmdImport(sWindowTitle, localoperation); break; - case SVNProgress_Lock: + case GitProgress_Lock: bSuccess = CmdLock(sWindowTitle, localoperation); break; - case SVNProgress_Merge: + case GitProgress_Merge: bSuccess = CmdMerge(sWindowTitle, localoperation); break; - case SVNProgress_MergeAll: + case GitProgress_MergeAll: bSuccess = CmdMergeAll(sWindowTitle, localoperation); break; - case SVNProgress_MergeReintegrate: + case GitProgress_MergeReintegrate: bSuccess = CmdMergeReintegrate(sWindowTitle, localoperation); break; - case SVNProgress_Rename: + case GitProgress_Rename: bSuccess = CmdRename(sWindowTitle, localoperation); break; - case SVNProgress_Resolve: + case GitProgress_Resolve: bSuccess = CmdResolve(sWindowTitle, localoperation); break; - case SVNProgress_Revert: + case GitProgress_Revert: bSuccess = CmdRevert(sWindowTitle, localoperation); break; - case SVNProgress_Switch: + case GitProgress_Switch: bSuccess = CmdSwitch(sWindowTitle, localoperation); break; - case SVNProgress_Unlock: + case GitProgress_Unlock: bSuccess = CmdUnlock(sWindowTitle, localoperation); break; - case SVNProgress_Update: + case GitProgress_Update: bSuccess = CmdUpdate(sWindowTitle, localoperation); break; } @@ -967,6 +986,7 @@ UINT CGitProgressDlg::ProgressThread() void CGitProgressDlg::OnBnClickedLogbutton() { +#if 0 if (m_targetPathList.GetCount() != 1) return; StringRevMap::iterator it = m_UpdateStartRevMap.begin(); @@ -978,6 +998,7 @@ void CGitProgressDlg::OnBnClickedLogbutton() CLogDlg dlg; dlg.SetParams(m_targetPathList[0], m_RevisionEnd, m_RevisionEnd, rev, 0, TRUE); dlg.DoModal(); +#endif } @@ -1104,6 +1125,7 @@ void CGitProgressDlg::OnNMCustomdrawSvnprogress(NMHDR *pNMHDR, LRESULT *pResult) void CGitProgressDlg::OnNMDblclkSvnprogress(NMHDR *pNMHDR, LRESULT *pResult) { +#if 0 LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); *pResult = 0; if (pNMLV->iItem < 0) @@ -1120,10 +1142,10 @@ void CGitProgressDlg::OnNMDblclkSvnprogress(NMHDR *pNMHDR, LRESULT *pResult) // We've double-clicked on a conflicted item - do a three-way merge on it SVNDiff::StartConflictEditor(data->path); } - else if ((data->action == svn_wc_notify_update_update) && ((data->content_state == svn_wc_notify_state_merged)||(SVNProgress_Merge == m_Command)) || (data->action == svn_wc_notify_resolved)) + else if ((data->action == svn_wc_notify_update_update) && ((data->content_state == svn_wc_notify_state_merged)||(GitProgress_Merge == m_Command)) || (data->action == svn_wc_notify_resolved)) { // This is a modified file which has been merged on update. Diff it against base - CTSVNPath temporaryFile; + CTGitPath temporaryFile; SVNDiff diff(this, this->m_hWnd, true); diff.SetAlternativeTool(!!(GetAsyncKeyState(VK_SHIFT) & 0x8000)); svn_revnum_t baseRev = 0; @@ -1142,6 +1164,7 @@ void CGitProgressDlg::OnNMDblclkSvnprogress(NMHDR *pNMHDR, LRESULT *pResult) CAppUtils::LaunchApplication(cmd, NULL, false); } } +#endif } void CGitProgressDlg::OnHdnItemclickSvnprogress(NMHDR *pNMHDR, LRESULT *pResult) @@ -1171,8 +1194,9 @@ bool CGitProgressDlg::NotificationDataIsAux(const NotificationData* pData) return pData->bAuxItem; } -LRESULT CGitProgressDlg::OnSVNProgress(WPARAM /*wParam*/, LPARAM lParam) +LRESULT CGitProgressDlg::OnGitProgress(WPARAM /*wParam*/, LPARAM lParam) { +#if 0 SVNProgress * pProgressData = (SVNProgress *)lParam; CProgressCtrl * progControl = (CProgressCtrl *)GetDlgItem(IDC_PROGRESSBAR); if ((pProgressData->total > 1000)&&(!progControl->IsWindowVisible())) @@ -1200,6 +1224,7 @@ LRESULT CGitProgressDlg::OnSVNProgress(WPARAM /*wParam*/, LPARAM lParam) m_sTotalBytesTransferred.Format(IDS_SVN_PROGRESS_TOTALMBTRANSFERRED, (double)((double)pProgressData->overall_total / 1024000.0)); progText.Format(IDS_SVN_PROGRESS_TOTALANDSPEED, (LPCTSTR)m_sTotalBytesTransferred, (LPCTSTR)pProgressData->SpeedString); SetDlgItemText(IDC_PROGRESSLABEL, progText); +#endif return 0; } @@ -1271,7 +1296,7 @@ bool CGitProgressDlg::SortCompare(const NotificationData * pData1, const Notific // Sort by path if everything else is equal if (result == 0) { - result = CTSVNPath::Compare(pData1->path, pData2->path); + result = CTGitPath::Compare(pData1->path, pData2->path); } if (!m_bAscending) @@ -1361,6 +1386,7 @@ BOOL CGitProgressDlg::PreTranslateMessage(MSG* pMsg) void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) { +#if 0 if (m_options & ProgOptDryRun) return; // don't do anything in a dry-run. @@ -1405,7 +1431,7 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) popup.AppendMenuIcon(ID_CONFLICTUSETHEIRS, IDS_SVNPROGRESS_MENUUSETHEIRS,IDI_RESOLVE); popup.AppendMenuIcon(ID_CONFLICTUSEMINE, IDS_SVNPROGRESS_MENUUSEMINE,IDI_RESOLVE); } - else if ((data->content_state == svn_wc_notify_state_merged)||(SVNProgress_Merge == m_Command)||(data->action == svn_wc_notify_resolved)) + else if ((data->content_state == svn_wc_notify_state_merged)||(GitProgress_Merge == m_Command)||(data->action == svn_wc_notify_resolved)) popup.SetDefaultItem(ID_COMPARE, FALSE); if (m_ProgList.GetSelectedCount() == 1) @@ -1436,9 +1462,9 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) if (data) { CString sPath = GetPathFromColumnText(data->sPathColumnText); - if ((!sPath.IsEmpty())&&(!SVN::PathIsURL(CTSVNPath(sPath)))) + if ((!sPath.IsEmpty())&&(!SVN::PathIsURL(CTGitPath(sPath)))) { - CTSVNPath path = CTSVNPath(sPath); + CTGitPath path = CTGitPath(sPath); if (path.GetDirectory().Exists()) { popup.AppendMenuIcon(ID_EXPLORE, IDS_SVNPROGRESS_MENUOPENPARENT, IDI_EXPLORER); @@ -1488,7 +1514,7 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) { CString sPath = GetPathFromColumnText(data->sPathColumnText); - CTSVNPath path = CTSVNPath(sPath); + CTGitPath path = CTGitPath(sPath); ShellExecute(m_hWnd, _T("explore"), path.GetDirectory().GetWinPath(), NULL, path.GetDirectory().GetWinPath(), SW_SHOW); } break; @@ -1505,8 +1531,8 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) // if the file was merged during update, do a three way diff between OLD, MINE, THEIRS if (data->content_state == svn_wc_notify_state_merged) { - CTSVNPath basefile = CTempFiles::Instance().GetTempFilePath(false, data->path, rev); - CTSVNPath newfile = CTempFiles::Instance().GetTempFilePath(false, data->path, SVNRev::REV_HEAD); + CTGitPath basefile = CTempFiles::Instance().GetTempFilePath(false, data->path, rev); + CTGitPath newfile = CTempFiles::Instance().GetTempFilePath(false, data->path, SVNRev::REV_HEAD); SVN svn; if (!svn.Cat(data->path, SVNRev(SVNRev::REV_WC), rev, basefile)) { @@ -1517,7 +1543,7 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) // If necessary, convert the line-endings on the file before diffing if ((DWORD)CRegDWORD(_T("Software\\TortoiseGit\\ConvertBase"), TRUE)) { - CTSVNPath temporaryFile = CTempFiles::Instance().GetTempFilePath(false, data->path, SVNRev::REV_BASE); + CTGitPath temporaryFile = CTempFiles::Instance().GetTempFilePath(false, data->path, SVNRev::REV_BASE); if (!svn.Cat(data->path, SVNRev(SVNRev::REV_BASE), SVNRev(SVNRev::REV_BASE), temporaryFile)) { temporaryFile.Reset(); @@ -1539,7 +1565,7 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) } else { - CTSVNPath tempfile = CTempFiles::Instance().GetTempFilePath(false, data->path, rev); + CTGitPath tempfile = CTempFiles::Instance().GetTempFilePath(false, data->path, rev); SVN svn; if (!svn.Cat(data->path, SVNRev(SVNRev::REV_WC), rev, tempfile)) { @@ -1563,7 +1589,7 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) case ID_EDITCONFLICT: { CString sPath = GetPathFromColumnText(data->sPathColumnText); - SVNDiff::StartConflictEditor(CTSVNPath(sPath)); + SVNDiff::StartConflictEditor(CTGitPath(sPath)); } break; case ID_CONFLICTUSETHEIRS: @@ -1651,7 +1677,7 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) // the path might be inside an external folder which has its own // revisions. CString sPath = GetPathFromColumnText(data->sPathColumnText); - dlg.SetParams(CTSVNPath(sPath), SVNRev(), SVNRev::REV_HEAD, 1, limit, TRUE); + dlg.SetParams(CTGitPath(sPath), SVNRev(), SVNRev::REV_HEAD, 1, limit, TRUE); dlg.DoModal(); } break; @@ -1677,6 +1703,7 @@ void CGitProgressDlg::OnContextMenu(CWnd* pWnd, CPoint point) } } } +#endif } void CGitProgressDlg::OnEnSetfocusInfotext() @@ -1690,7 +1717,7 @@ void CGitProgressDlg::OnEnSetfocusInfotext() void CGitProgressDlg::OnLvnBegindragSvnprogress(NMHDR* , LRESULT *pResult) { //LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); - +#if 0 int selIndex = m_ProgList.GetSelectionMark(); if (selIndex < 0) return; @@ -1715,7 +1742,7 @@ void CGitProgressDlg::OnLvnBegindragSvnprogress(NMHDR* , LRESULT *pResult) { dropFiles.CreateStructure(); } - +#endif *pResult = 0; } @@ -1724,6 +1751,9 @@ void CGitProgressDlg::OnSize(UINT nType, int cx, int cy) CResizableStandAloneDialog::OnSize(nType, cx, cy); if ((nType == SIZE_RESTORED)&&(m_bLastVisible)) { + if(!m_ProgList.m_hWnd) + return; + int count = m_ProgList.GetItemCount(); if (count > 0) m_ProgList.EnsureVisible(count-1, false); @@ -1735,28 +1765,46 @@ void CGitProgressDlg::OnSize(UINT nType, int cx, int cy) ////////////////////////////////////////////////////////////////////////// bool CGitProgressDlg::CmdAdd(CString& sWindowTitle, bool& localoperation) { + localoperation = true; sWindowTitle.LoadString(IDS_PROGRS_TITLE_ADD); SetWindowText(sWindowTitle); SetBackgroundImage(IDI_ADD_BKG); ReportCmd(CString(MAKEINTRESOURCE(IDS_PROGRS_CMD_ADD))); + + for(int i=0;iShowWindow(SW_HIDE); GetDlgItem(IDC_INFOTEXT)->ShowWindow(SW_SHOW); return !bFailed; +#endif + return true; } bool CGitProgressDlg::CmdMergeAll(CString& sWindowTitle, bool& /*localoperation*/) { +#if 0 ASSERT(m_targetPathList.GetCount() == 1); sWindowTitle.LoadString(IDS_PROGRS_TITLE_MERGE); SetBackgroundImage(IDI_MERGE_BKG); @@ -2153,7 +2216,7 @@ bool CGitProgressDlg::CmdMergeAll(CString& sWindowTitle, bool& /*localoperation* CString sCmdInfo; sCmdInfo.LoadString(IDS_PROGRS_INFOGETTINGINFO); ReportCmd(sCmdInfo); - CTSVNPathList suggestedSources; + CTGitPathList suggestedSources; if (!SuggestMergeSources(m_targetPathList[0], m_Revision, suggestedSources)) { ReportSVNError(); @@ -2192,11 +2255,13 @@ bool CGitProgressDlg::CmdMergeAll(CString& sWindowTitle, bool& /*localoperation* } GetDlgItem(IDC_NONINTERACTIVE)->ShowWindow(SW_HIDE); +#endif return true; } bool CGitProgressDlg::CmdMergeReintegrate(CString& sWindowTitle, bool& /*localoperation*/) { +#if 0 ASSERT(m_targetPathList.GetCount() == 1); sWindowTitle.LoadString(IDS_PROGRS_TITLE_MERGEREINTEGRATE); SetBackgroundImage(IDI_MERGE_BKG); @@ -2224,11 +2289,13 @@ bool CGitProgressDlg::CmdMergeReintegrate(CString& sWindowTitle, bool& /*localop } GetDlgItem(IDC_NONINTERACTIVE)->ShowWindow(SW_HIDE); +#endif return true; } bool CGitProgressDlg::CmdRename(CString& sWindowTitle, bool& localoperation) { +#if 0 ASSERT(m_targetPathList.GetCount() == 1); if ((!m_targetPathList[0].IsUrl())&&(!m_url.IsUrl())) localoperation = true; @@ -2241,11 +2308,13 @@ bool CGitProgressDlg::CmdRename(CString& sWindowTitle, bool& localoperation) ReportSVNError(); return false; } +#endif return true; } bool CGitProgressDlg::CmdResolve(CString& sWindowTitle, bool& localoperation) { +#if 0 localoperation = true; ASSERT(m_targetPathList.GetCount() == 1); sWindowTitle.LoadString(IDS_PROGRS_TITLE_RESOLVE); @@ -2301,17 +2370,19 @@ bool CGitProgressDlg::CmdResolve(CString& sWindowTitle, bool& localoperation) Resolve(m_targetPathList[fileindex], svn_wc_conflict_choose_merged, true); } CShellUpdater::Instance().AddPathsForUpdate(m_targetPathList); +#endif return true; } bool CGitProgressDlg::CmdRevert(CString& sWindowTitle, bool& localoperation) { +#if 0 localoperation = true; sWindowTitle.LoadString(IDS_PROGRS_TITLE_REVERT); SetWindowText(sWindowTitle); SetBackgroundImage(IDI_REVERT_BKG); - CTSVNPathList delList = m_selectedPaths; + CTGitPathList delList = m_selectedPaths; if (DWORD(CRegDWORD(_T("Software\\TortoiseGit\\RevertWithRecycleBin"), TRUE))) delList.DeleteAllFiles(true); @@ -2322,11 +2393,13 @@ bool CGitProgressDlg::CmdRevert(CString& sWindowTitle, bool& localoperation) return false; } CShellUpdater::Instance().AddPathsForUpdate(m_targetPathList); +#endif return true; } bool CGitProgressDlg::CmdSwitch(CString& sWindowTitle, bool& /*localoperation*/) { +#if 0 ASSERT(m_targetPathList.GetCount() == 1); SVNStatus st; sWindowTitle.LoadString(IDS_PROGRS_TITLE_SWITCH); @@ -2361,11 +2434,13 @@ bool CGitProgressDlg::CmdSwitch(CString& sWindowTitle, bool& /*localoperation*/) { GetDlgItem(IDC_LOGBUTTON)->ShowWindow(SW_SHOW); } +#endif return true; } bool CGitProgressDlg::CmdUnlock(CString& sWindowTitle, bool& /*localoperation*/) { +#if 0 sWindowTitle.LoadString(IDS_PROGRS_TITLE_UNLOCK); SetWindowText(sWindowTitle); SetBackgroundImage(IDI_UNLOCK_BKG); @@ -2376,11 +2451,13 @@ bool CGitProgressDlg::CmdUnlock(CString& sWindowTitle, bool& /*localoperation*/) return false; } CShellUpdater::Instance().AddPathsForUpdate(m_targetPathList); +#endif return true; } bool CGitProgressDlg::CmdUpdate(CString& sWindowTitle, bool& /*localoperation*/) { +#if 0 sWindowTitle.LoadString(IDS_PROGRS_TITLE_UPDATE); SetWindowText(sWindowTitle); SetBackgroundImage(IDI_UPDATE_BKG); @@ -2393,7 +2470,7 @@ bool CGitProgressDlg::CmdUpdate(CString& sWindowTitle, bool& /*localoperation*/) int nUUIDs = 0; for(int nItem = 0; nItem < targetcount; nItem++) { - const CTSVNPath& targetPath = m_targetPathList[nItem]; + const CTGitPath& targetPath = m_targetPathList[nItem]; SVNStatus st; LONG headrev = -1; m_Revision = revstore; @@ -2456,12 +2533,12 @@ bool CGitProgressDlg::CmdUpdate(CString& sWindowTitle, bool& /*localoperation*/) // so we have to update them separately for(int nItem = 0; nItem < targetcount; nItem++) { - const CTSVNPath& targetPath = m_targetPathList[nItem]; + const CTGitPath& targetPath = m_targetPathList[nItem]; m_basePath = targetPath; CString sNotify; sNotify.Format(IDS_PROGRS_UPDATEPATH, m_basePath.GetWinPath()); ReportString(sNotify, CString(MAKEINTRESOURCE(IDS_WARN_NOTE))); - if (!Update(CTSVNPathList(targetPath), revstore, m_depth, TRUE, m_options & ProgOptIgnoreExternals)) + if (!Update(CTGitPathList(targetPath), revstore, m_depth, TRUE, m_options & ProgOptIgnoreExternals)) { ReportSVNError(); return false; @@ -2478,8 +2555,8 @@ bool CGitProgressDlg::CmdUpdate(CString& sWindowTitle, bool& /*localoperation*/) // to update all intermediate folders manually if ((m_targetPathList.GetCount() == 1) && (!m_targetPathList[0].Exists())) { - CTSVNPath wcPath = m_targetPathList[0].GetContainingDirectory(); - CTSVNPath existingParentPath = wcPath.GetContainingDirectory(); + CTGitPath wcPath = m_targetPathList[0].GetContainingDirectory(); + CTGitPath existingParentPath = wcPath.GetContainingDirectory(); while (!existingParentPath.Exists() && (existingParentPath.GetWinPathString().GetLength() > 2)) { existingParentPath = existingParentPath.GetContainingDirectory(); @@ -2487,7 +2564,7 @@ bool CGitProgressDlg::CmdUpdate(CString& sWindowTitle, bool& /*localoperation*/) if (existingParentPath.GetWinPathString().GetLength() && !existingParentPath.IsEquivalentTo(wcPath)) { // update all intermediate directories with depth 'empty' - CTSVNPath intermediatepath = existingParentPath; + CTGitPath intermediatepath = existingParentPath; bool bSuccess = true; while (bSuccess && intermediatepath.IsAncestorOf(wcPath) && !intermediatepath.IsEquivalentTo(wcPath)) { @@ -2497,7 +2574,7 @@ bool CGitProgressDlg::CmdUpdate(CString& sWindowTitle, bool& /*localoperation*/) intermediatepath = wcPath; else intermediatepath.AppendPathString(childname); - bSuccess = !!Update(CTSVNPathList(intermediatepath), m_Revision, svn_depth_empty, false, true); + bSuccess = !!Update(CTGitPathList(intermediatepath), m_Revision, svn_depth_empty, false, true); } if (!bSuccess) @@ -2528,7 +2605,7 @@ bool CGitProgressDlg::CmdUpdate(CString& sWindowTitle, bool& /*localoperation*/) // (either a file or a directory) if ((m_targetPathList.GetCount() == 1)&&(m_UpdateStartRevMap.size()>0)) GetDlgItem(IDC_LOGBUTTON)->ShowWindow(SW_SHOW); - +#endif return true; } diff --git a/src/TortoiseProc/SVNProgressDlg.h b/src/TortoiseProc/SVNProgressDlg.h index 99e1ce9..aaf4aad 100644 --- a/src/TortoiseProc/SVNProgressDlg.h +++ b/src/TortoiseProc/SVNProgressDlg.h @@ -66,6 +66,11 @@ typedef enum #define WM_SHOWCONFLICTRESOLVER (WM_APP + 100) +typedef enum +{ + git_wc_notify_add, + +}git_wc_notify_action_t; /** * \ingroup TortoiseProc * Handles different Subversion commands and shows the notify messages @@ -140,14 +145,15 @@ private: class NotificationData { public: - NotificationData() : + NotificationData(){} ; + git_wc_notify_action_t action; #if 0 action((git_wc_notify_action_t)-1), kind(git_node_none), content_state(git_wc_notify_state_inapplicable), prop_state(git_wc_notify_state_inapplicable), rev(0), -#endif + color(::GetSysColor(COLOR_WINDOWTEXT)), bConflictedActionItem(false), bAuxItem(false) @@ -157,6 +163,7 @@ private: // merge_range.end = 0; // merge_range.start = 0; } +#endif public: // The text we put into the first column (the Git action for normal items, just text for aux items) CString sActionColumnText; @@ -181,16 +188,18 @@ private: }; protected: -#if 0 //implement the virtual methods from Git base class - virtual BOOL Notify(const CTGitPath& path, git_wc_notify_action_t action, + //Need update in the future implement the virtual methods from Git base class + virtual BOOL Notify(const CTGitPath& path, git_wc_notify_action_t action + /* git_node_kind_t kind, const CString& mime_type, git_wc_notify_state_t content_state, git_wc_notify_state_t prop_state, LONG rev, const git_lock_t * lock, git_wc_notify_lock_state_t lock_state, const CString& changelistname, git_merge_range_t * range, - git_error_t * err, apr_pool_t * pool); -#endif + git_error_t * err, apr_pool_t * pool*/ + ); + // virtual git_wc_conflict_choice_t ConflictResolveCallback(const git_wc_conflict_description_t *description, CString& mergedfile); virtual BOOL OnInitDialog(); virtual BOOL Cancel(); diff --git a/src/TortoiseProc/TortoiseProc.vcproj b/src/TortoiseProc/TortoiseProc.vcproj index 15adeea..79a1332 100644 --- a/src/TortoiseProc/TortoiseProc.vcproj +++ b/src/TortoiseProc/TortoiseProc.vcproj @@ -401,6 +401,14 @@ > + + + + @@ -578,11 +586,11 @@ > + + + + + + + +