OSDN Git Service

Fix bug messing up overlays after attempted commit with empty message.
authorColin Law <colin@clanlaw.org.uk>
Tue, 3 Feb 2009 12:36:10 +0000 (12:36 +0000)
committerFrank Li <lznuaa@gmail.com>
Tue, 3 Feb 2009 12:54:54 +0000 (20:54 +0800)
If an attempt is made to commit with no message entered the commit fails but
then the overlay for files marked for commit is set to unmodified.
Fixed by trapping empty message before attempting commit.

src/Resources/TortoiseProcENG.rc
src/TortoiseProc/CommitDlg.cpp
src/TortoiseProc/resource.h

index 8e682f0..90a61f0 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 60d7edc..e9bd3be 100644 (file)
@@ -316,6 +316,12 @@ void CCommitDlg::OnOK()
                return;\r
        }\r
        m_sLogMessage = m_cLogMessage.GetText();\r
+       if ( m_sLogMessage.IsEmpty() )\r
+       {\r
+               // no message entered, go round again\r
+               CMessageBox::Show(this->m_hWnd, IDS_COMMITDLG_NOMESSAGE, IDS_APPNAME, MB_OK | MB_ICONERROR);\r
+               return;\r
+       }\r
        if ((m_ProjectProperties.bWarnIfNoIssue) && (id.IsEmpty() && !m_ProjectProperties.HasBugID(m_sLogMessage)))\r
        {\r
                if (CMessageBox::Show(this->m_hWnd, IDS_COMMITDLG_NOISSUEWARNING, IDS_APPNAME, MB_YESNO | MB_ICONWARNING)!=IDYES)\r
@@ -706,7 +712,7 @@ UINT CCommitDlg::StatusThread()
                {\r
                        m_bShowUnversioned = TRUE;\r
                        GetDlgItem(IDC_SHOWUNVERSIONED)->SendMessage(BM_SETCHECK, BST_CHECKED);\r
-                       DWORD dwShow = SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS | SVNSLC_SHOWUNVERSIONED | SVNSLC_SHOWLOCKS;\r
+                       DWORD dwShow = (DWORD)(SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS | SVNSLC_SHOWUNVERSIONED | SVNSLC_SHOWLOCKS);\r
                        m_ListCtrl.UpdateFileList(CGitStatusListCtrl::FILELIST_UNVER);\r
                        m_ListCtrl.Show(dwShow);\r
                }\r
@@ -916,7 +922,7 @@ LRESULT CCommitDlg::OnGitStatusListCtrlNeedsRefresh(WPARAM, LPARAM)
        return 0;\r
 }\r
 \r
-LRESULT CCommitDlg::OnFileDropped(WPARAM, LPARAM lParam)\r
+LRESULT CCommitDlg::OnFileDropped(WPARAM, LPARAM /*lParam*/)\r
 {\r
 #if 0\r
        BringWindowToTop();\r
@@ -1197,7 +1203,7 @@ void CCommitDlg::InsertMenuItems(CMenu& mPopup, int& nCmd)
        mPopup.AppendMenu(MF_STRING | MF_ENABLED, m_nPopupPasteListCmd, sMenuItemText);\r
 }\r
 \r
-bool CCommitDlg::HandleMenuItemClick(int cmd, CSciEdit * pSciEdit)\r
+bool CCommitDlg::HandleMenuItemClick(int /*cmd*/, CSciEdit * /*pSciEdit*/)\r
 {\r
 #if 0\r
        if (m_bBlock)\r
index af989ee..f156f38 100644 (file)
Binary files a/src/TortoiseProc/resource.h and b/src/TortoiseProc/resource.h differ