1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2007-2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "PrevDiffCommand.h"
22 #include "GitStatus.h"
23 #include "MessageBox.h"
24 #include "ChangedDlg.h"
25 #include "LogDlgHelper.h"
26 #include "CommonResource.h"
28 bool PrevDiffCommand::Execute()
31 bool bAlternativeTool
= !!parser
.HasKey(_T("alternative"));
32 if (cmdLinePath
.IsDirectory())
35 dlg
.m_pathList
= CTGitPathList(cmdLinePath
);
42 // diff.SetAlternativeTool(bAlternativeTool);
44 st
.GetStatus(cmdLinePath
);
53 revs
.ParserShortLog(&cmdLinePath
,hash
,2);
56 CMessageBox::Show(hWndExplorer
, IDS_ERR_NOPREVREVISION
, IDS_APPNAME
, MB_ICONERROR
);
60 if( revs
.size() == 1 )
63 bRet
= (diff
.DiffNull(&cmdLinePath
,revs
[0].m_CommitHash
) != 0);
66 if( revs
.size() == 2 )
69 bRet
= diff
.Diff(&cmdLinePath
,&cmdLinePath
, revs
[0].m_CommitHash
, revs
[1].m_CommitHash
, false);
74 //if (st.GetLastErrorMsg().IsEmpty())
76 CMessageBox::Show(hWndExplorer
, IDS_ERR_NOPREVREVISION
, IDS_APPNAME
, MB_ICONERROR
);
80 // CMessageBox::Show(hWndExplorer, IDS_ERR_NOSTATUS, IDS_APPNAME, MB_ICONERROR);