OSDN Git Service

Add Patch Import Command (git am)
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Commands / ShowCompareCommand.cpp
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2008 - TortoiseSVN\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 //\r
19 #include "StdAfx.h"\r
20 #include "ShowCompareCommand.h"\r
21 //#include "SVNDiff.h"\r
22 \r
23 \r
24 bool ShowCompareCommand::Execute()\r
25 {\r
26 #if 0\r
27         bool            bRet = false;\r
28         SVNDiff         diff(NULL, hwndExplorer);\r
29 \r
30         SVNRev          rev1;\r
31         SVNRev          rev2;\r
32         SVNRev          pegrev;\r
33         SVNRev          headpeg;\r
34 \r
35         CTSVNPath       url1 = CTSVNPath(parser.GetVal(_T("url1")));\r
36         CTSVNPath       url2 = CTSVNPath(parser.GetVal(_T("url2")));\r
37         bool            ignoreancestry = !!parser.HasKey(_T("ignoreancestry"));\r
38         bool            blame = !!parser.HasKey(_T("blame"));\r
39         bool            unified = !!parser.HasKey(_T("unified"));\r
40 \r
41         if (parser.HasVal(_T("revision1")))\r
42                 rev1 = SVNRev(parser.GetVal(_T("revision1")));\r
43         if (parser.HasVal(_T("revision2")))\r
44                 rev2 = SVNRev(parser.GetVal(_T("revision2")));\r
45         if (parser.HasVal(_T("pegrevision")))\r
46                 pegrev = SVNRev(parser.GetVal(_T("pegrevision")));\r
47         if (parser.HasVal(_T("headpegrevision")))\r
48                 diff.SetHEADPeg(SVNRev(parser.GetVal(_T("headpegrevision"))));\r
49         diff.SetAlternativeTool(!!parser.HasKey(_T("alternatediff")));\r
50 \r
51         if (unified)\r
52                 bRet = diff.ShowUnifiedDiff(url1, rev1, url2, rev2, pegrev, ignoreancestry);\r
53         else\r
54                 bRet = diff.ShowCompare(url1, rev1, url2, rev2, pegrev, ignoreancestry, blame);\r
55 \r
56         return bRet;\r
57 #endif \r
58         return 0;\r
59 }\r