1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 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 "ShowCompareCommand.h"
21 //#include "SVNDiff.h"
24 bool ShowCompareCommand::Execute()
28 SVNDiff
diff(NULL
, hwndExplorer
);
35 CTSVNPath url1
= CTSVNPath(parser
.GetVal(_T("url1")));
36 CTSVNPath url2
= CTSVNPath(parser
.GetVal(_T("url2")));
37 bool ignoreancestry
= !!parser
.HasKey(_T("ignoreancestry"));
38 bool blame
= !!parser
.HasKey(_T("blame"));
39 bool unified
= !!parser
.HasKey(_T("unified"));
41 if (parser
.HasVal(_T("revision1")))
42 rev1
= SVNRev(parser
.GetVal(_T("revision1")));
43 if (parser
.HasVal(_T("revision2")))
44 rev2
= SVNRev(parser
.GetVal(_T("revision2")));
45 if (parser
.HasVal(_T("pegrevision")))
46 pegrev
= SVNRev(parser
.GetVal(_T("pegrevision")));
47 if (parser
.HasVal(_T("headpegrevision")))
48 diff
.SetHEADPeg(SVNRev(parser
.GetVal(_T("headpegrevision"))));
49 diff
.SetAlternativeTool(!!parser
.HasKey(_T("alternatediff")));
52 bRet
= diff
.ShowUnifiedDiff(url1
, rev1
, url2
, rev2
, pegrev
, ignoreancestry
);
54 bRet
= diff
.ShowCompare(url1
, rev1
, url2
, rev2
, pegrev
, ignoreancestry
, blame
);