1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2009-2012 - TortoiseGit
4 // Copyright (C) 2007-2008 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "RebaseCommand.h"
23 #include "MessageBox.h"
24 #include "RebaseDlg.h"
25 #include "InputLogDlg.h"
27 #include "DirFileEnum.h"
28 #include "ShellUpdater.h"
29 #include "SysProgressDlg.h"
32 bool RebaseCommand::Execute()
36 if(!g_Git
.CheckCleanWorkTree())
38 if (CMessageBox::Show(NULL
, IDS_ERROR_NOCLEAN_STASH
, IDS_APPNAME
, 1, IDI_QUESTION
, IDS_STASHBUTTON
, IDS_ABORTBUTTON
) == 1)
40 CSysProgressDlg sysProgressDlg
;
41 sysProgressDlg
.SetTitle(CString(MAKEINTRESOURCE(IDS_APPNAME
)));
42 sysProgressDlg
.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_STASHRUNNING
)));
43 sysProgressDlg
.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROGRESSWAIT
)));
44 sysProgressDlg
.SetShowProgressBar(false);
45 sysProgressDlg
.SetCancelMsg(IDS_PROGRS_INFOFAILED
);
46 sysProgressDlg
.ShowModeless((HWND
)NULL
, true);
49 cmd
=_T("git.exe stash");
50 if (g_Git
.Run(cmd
, &out
, CP_UTF8
))
52 sysProgressDlg
.Stop();
53 CMessageBox::Show(NULL
,out
,_T("TortoiseGit"),MB_OK
);
56 sysProgressDlg
.Stop();
67 dlg
.m_PostButtonTexts
.Add(CString(MAKEINTRESOURCE(IDS_MENULOG
)));
68 dlg
.m_PostButtonTexts
.Add(CString(MAKEINTRESOURCE(IDS_PROC_RESTARTREBASE
)));
69 INT_PTR ret
= dlg
.DoModal();
80 if (ret
== IDC_REBASE_POST_BUTTON
)
82 CString cmd
= _T("/command:log");
83 cmd
+= _T(" /path:\"") + g_Git
.m_CurrentDir
+ _T("\"");
84 CAppUtils::RunTortoiseGitProc(cmd
);