proc += key;\r
proc += _T("\"");\r
\r
- return LaunchApplication(proc, IDS_ERR_EXTDIFFSTART, false);\r
+ return LaunchApplication(proc, IDS_ERR_PAGEANT, false);\r
}\r
bool CAppUtils::LaunchRemoteSetting()\r
{\r
CString cmd;\r
if(rev1 == GitRev::GetWorkingCopy())\r
{\r
- cmd.Format(_T("git.exe diff --stat -p %s"),rev2);\r
+ cmd.Format(_T("git.exe diff --stat -p %s "),rev2);\r
}else\r
{ \r
cmd.Format(_T("git.exe diff-tree -r -p --stat %s %s"),rev1,rev2);\r
}\r
+\r
+ if( !url1.IsEmpty() )\r
+ {\r
+ cmd+=_T(" \"");\r
+ cmd+=url1.GetGitPathString();\r
+ cmd+=_T("\" ");\r
+ }\r
g_Git.RunLogFile(cmd,tempfile);\r
CAppUtils::StartUnifiedDiffViewer(tempfile,rev1.Left(6)+_T(":")+rev2.Left(6));\r
\r
return true;\r
}\r
return false;\r
+}\r
+int CAppUtils::GetLogOutputEncode()\r
+{\r
+ CString cmd,output;\r
+ int start=0;\r
+ cmd=_T("git.exe config i18n.logOutputEncoding");\r
+ if(g_Git.Run(cmd,&output,CP_ACP))\r
+ {\r
+ cmd=_T("git.exe config i18n.commitencoding");\r
+ if(g_Git.Run(cmd,&output,CP_ACP))\r
+ return CP_UTF8;\r
+ \r
+ int start=0;\r
+ output=output.Tokenize(_T("\n"),start);\r
+ return CUnicodeUtils::GetCPCode(output); \r
+\r
+ }else\r
+ {\r
+ output=output.Tokenize(_T("\n"),start);\r
+ return CUnicodeUtils::GetCPCode(output);\r
+ }\r
+}\r
+int CAppUtils::SaveCommitUnicodeFile(CString &filename, CString &message)\r
+{\r
+ CFile file(filename,CFile::modeReadWrite|CFile::modeCreate );\r
+ CString cmd,output;\r
+ int cp=CP_UTF8;\r
+\r
+ cmd=_T("git.exe config i18n.commitencoding");\r
+ if(g_Git.Run(cmd,&output,CP_ACP))\r
+ cp=CP_UTF8;\r
+ \r
+ int start=0;\r
+ output=output.Tokenize(_T("\n"),start);\r
+ cp=CUnicodeUtils::GetCPCode(output); \r
+\r
+ int len=message.GetLength();\r
+\r
+ char * buf;\r
+ buf = new char[len*4 + 4];\r
+ SecureZeroMemory(buf, (len*4 + 4));\r
+\r
+ int lengthIncTerminator = WideCharToMultiByte(cp, 0, message, -1, buf, len*4, NULL, NULL);\r
+\r
+ file.Write(buf,lengthIncTerminator-1);\r
+ file.Close();\r
+ delete buf;\r
+ return 0;\r
}
\ No newline at end of file