OSDN Git Service

Show User and Email info at setting dialog
[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 \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         GitRev revstart ;\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         GitRev revend ;\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 \r
52         GitRev pegrev;\r
53 \r
54 #if 0\r
55         SVNRev pegrev = val.IsEmpty() ? SVNRev() : SVNRev(val);\r
56         if (!revstart.IsValid())\r
57                 revstart = SVNRev::REV_HEAD;\r
58         if (!revend.IsValid())\r
59                 revend = 0;\r
60 #endif\r
61 \r
62         if (limit == 0)\r
63         {\r
64                 CRegDWORD reg = CRegDWORD(_T("Software\\TortoiseGit\\NumberOfLogs"), 100);\r
65                 limit = (int)(LONG)reg;\r
66         }\r
67         \r
68         CLogDlg dlg;\r
69         theApp.m_pMainWnd = &dlg;\r
70         //dlg.SetParams(cmdLinePath);\r
71         dlg.SetParams(cmdLinePath, pegrev, revstart, revend, limit);\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