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 "DiffCommand.h"
21 #include "PathUtils.h"
23 #include "ChangedDlg.h"
25 #include "GitStatus.h"
27 bool DiffCommand::Execute()
30 CString path2
= CPathUtils::GetLongPathname(parser
.GetVal(_T("path2")));
31 bool bAlternativeTool
= !!parser
.HasKey(_T("alternative"));
32 // bool bBlame = !!parser.HasKey(_T("blame"));
35 if (cmdLinePath
.IsDirectory())
38 dlg
.m_pathList
= CTGitPathList(cmdLinePath
);
45 //diff.SetAlternativeTool(bAlternativeTool);
47 if ( parser
.HasKey(_T("startrev")) && parser
.HasKey(_T("endrev")) )
49 //SVNRev StartRevision = SVNRev(parser.GetLongVal(_T("startrev")));
50 //SVNRev EndRevision = SVNRev(parser.GetLongVal(_T("endrev")));
51 //bRet = diff.ShowCompare(cmdLinePath, StartRevision, cmdLinePath, EndRevision, SVNRev(), false, bBlame);
56 //git_revnum_t baseRev = 0;
57 bRet
= diff
.Diff(&cmdLinePath
,&cmdLinePath
,git_revnum_t(GIT_REV_ZERO
),git_revnum_t(_T("HEAD")));
62 bRet
= CAppUtils::StartExtDiff(
63 path2
, orgCmdLinePath
.GetWinPathString(), CString(), CString(),
64 CAppUtils::DiffFlags().AlternativeTool(bAlternativeTool
));