OSDN Git Service

Improvements to Diff of modified version against head
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Commands / DiffCommand.cpp
index a39d576..dd081f8 100644 (file)
 #include "PathUtils.h"\r
 #include "AppUtils.h"\r
 #include "ChangedDlg.h"\r
-#include "SVNDiff.h"\r
-#include "SVNStatus.h"\r
+#include "GitDiff.h"\r
+#include "GitStatus.h"\r
 \r
 bool DiffCommand::Execute()\r
 {\r
        bool bRet = false;\r
        CString path2 = CPathUtils::GetLongPathname(parser.GetVal(_T("path2")));\r
        bool bAlternativeTool = !!parser.HasKey(_T("alternative"));\r
-       bool bBlame = !!parser.HasKey(_T("blame"));\r
+//     bool bBlame = !!parser.HasKey(_T("blame"));\r
        if (path2.IsEmpty())\r
        {\r
                if (cmdLinePath.IsDirectory())\r
                {\r
                        CChangedDlg dlg;\r
-                       dlg.m_pathList = CTSVNPathList(cmdLinePath);\r
+                       dlg.m_pathList = CTGitPathList(cmdLinePath);\r
                        dlg.DoModal();\r
                        bRet = true;\r
                }\r
                else\r
                {\r
-                       SVNDiff diff(NULL, hwndExplorer);\r
-                       diff.SetAlternativeTool(bAlternativeTool);\r
+                       CGitDiff diff;\r
+                       //diff.SetAlternativeTool(bAlternativeTool);\r
+#if 0\r
                        if ( parser.HasKey(_T("startrev")) && parser.HasKey(_T("endrev")) )\r
                        {\r
-                               SVNRev StartRevision = SVNRev(parser.GetLongVal(_T("startrev")));\r
-                               SVNRev EndRevision = SVNRev(parser.GetLongVal(_T("endrev")));\r
-                               bRet = diff.ShowCompare(cmdLinePath, StartRevision, cmdLinePath, EndRevision, SVNRev(), false, bBlame);\r
+                               //SVNRev StartRevision = SVNRev(parser.GetLongVal(_T("startrev")));\r
+                               //SVNRev EndRevision = SVNRev(parser.GetLongVal(_T("endrev")));\r
+                               //bRet = diff.ShowCompare(cmdLinePath, StartRevision, cmdLinePath, EndRevision, SVNRev(), false, bBlame);\r
                        }\r
                        else\r
+#endif\r
                        {\r
-                               svn_revnum_t baseRev = 0;\r
-                               bRet = diff.DiffFileAgainstBase(cmdLinePath, baseRev);\r
+                               //git_revnum_t baseRev = 0;\r
+                               bRet = diff.Diff(&cmdLinePath,&cmdLinePath,git_revnum_t(GIT_REV_ZERO),git_revnum_t(_T("HEAD")));\r
                        }\r
                }\r
        } \r
        else\r
                bRet = CAppUtils::StartExtDiff(\r
-                       CTSVNPath(path2), cmdLinePath, CString(), CString(),\r
+                       path2, orgCmdLinePath.GetWinPathString(), CString(), CString(),\r
                        CAppUtils::DiffFlags().AlternativeTool(bAlternativeTool));\r
        return bRet;\r
 }
\ No newline at end of file