OSDN Git Service

54d11074942fa73e095e8d1041d0e10c0d499043
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Commands / LogCommand.cpp
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2007-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 "LogCommand.h"\r
21 \r
22 #include "LogDlg.h"\r
23 \r
24 bool LogCommand::Execute()\r
25 {\r
26         //the log command line looks like this:\r
27         //command:log path:<path_to_file_or_directory_to_show_the_log_messages> [startrev:<startrevision>] [endrev:<endrevision>]\r
28 #if 0 \r
29         CString val = parser.GetVal(_T("startrev"));\r
30         if ( val.IsEmpty() )\r
31         {\r
32                 // support deprecated parameter prior 1.5.0\r
33                 val = parser.GetVal(_T("revstart"));\r
34         }\r
35         SVNRev revstart = val.IsEmpty() ? SVNRev() : SVNRev(val);\r
36         val = parser.GetVal(_T("endrev"));\r
37         if ( val.IsEmpty() )\r
38         {\r
39                 // support deprecated parameter prior 1.5.0\r
40                 val = parser.GetVal(_T("revend"));\r
41         }\r
42         SVNRev revend = val.IsEmpty() ? SVNRev() : SVNRev(val);\r
43         val = parser.GetVal(_T("limit"));\r
44         int limit = _tstoi(val);\r
45         val = parser.GetVal(_T("pegrev"));\r
46         if ( val.IsEmpty() )\r
47         {\r
48                 // support deprecated parameter prior 1.5.0\r
49                 val = parser.GetVal(_T("revpeg"));\r
50         }\r
51         SVNRev pegrev = val.IsEmpty() ? SVNRev() : SVNRev(val);\r
52         if (!revstart.IsValid())\r
53                 revstart = SVNRev::REV_HEAD;\r
54         if (!revend.IsValid())\r
55                 revend = 0;\r
56 \r
57         if (limit == 0)\r
58         {\r
59                 CRegDWORD reg = CRegDWORD(_T("Software\\TortoiseSVN\\NumberOfLogs"), 100);\r
60                 limit = (int)(LONG)reg;\r
61         }\r
62         BOOL bStrict = (DWORD)CRegDWORD(_T("Software\\TortoiseSVN\\LastLogStrict"), FALSE);\r
63         if (parser.HasKey(_T("strict")))\r
64         {\r
65                 bStrict = TRUE;\r
66         }\r
67 #endif  \r
68         \r
69         CLogDlg dlg;\r
70         theApp.m_pMainWnd = &dlg;\r
71 //      dlg.SetParams(cmdLinePath, pegrev, revstart, revend, limit, bStrict);\r
72 //      dlg.SetIncludeMerge(!!parser.HasKey(_T("merge")));\r
73 //      val = parser.GetVal(_T("propspath"));\r
74 //      if (!val.IsEmpty())\r
75 //              dlg.SetProjectPropertiesPath(CTSVNPath(val));\r
76         dlg.DoModal();                  \r
77         return true;\r
78 }\r