OSDN Git Service

diff command basic finished
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Commands / PrevDiffCommand.cpp
index 5584eea..d5a3c11 100644 (file)
@@ -18,9 +18,8 @@
 //\r
 #include "StdAfx.h"\r
 #include "PrevDiffCommand.h"\r
-#include "ChangedDlg.h"\r
-#include "SVNDiff.h"\r
-#include "SVNStatus.h"\r
+#include "GitDiff.h"\r
+#include "GitStatus.h"\r
 #include "MessageBox.h"\r
 \r
 bool PrevDiffCommand::Execute()\r
@@ -29,32 +28,33 @@ bool PrevDiffCommand::Execute()
        bool bAlternativeTool = !!parser.HasKey(_T("alternative"));\r
        if (cmdLinePath.IsDirectory())\r
        {\r
-               CChangedDlg dlg;\r
-               dlg.m_pathList = CTSVNPathList(cmdLinePath);\r
-               dlg.DoModal();\r
-               bRet = true;\r
+//             CChangedDlg dlg;\r
+//             dlg.m_pathList = CTSVNPathList(cmdLinePath);\r
+//             dlg.DoModal();\r
+//             bRet = true;\r
        }\r
        else\r
        {\r
-               SVNDiff diff;\r
-               diff.SetAlternativeTool(bAlternativeTool);\r
-               SVNStatus st;\r
+               CGitDiff diff;\r
+//             diff.SetAlternativeTool(bAlternativeTool);\r
+               GitStatus st;\r
                st.GetStatus(cmdLinePath);\r
-               if (st.status && st.status->entry && st.status->entry->cmt_rev)\r
+\r
+               if (1)\r
                {\r
-                       SVNDiff diff(NULL, hWndExplorer);\r
-                       bRet = diff.ShowCompare(cmdLinePath, SVNRev::REV_WC, cmdLinePath, st.status->entry->cmt_rev - 1, st.status->entry->cmt_rev);\r
+                       CGitDiff diff;\r
+                       bRet = diff.Diff(&cmdLinePath, git_revnum_t(_T("HEAD")), git_revnum_t(_T("HEAD~1")), false);\r
                }\r
                else\r
                {\r
-                       if (st.GetLastErrorMsg().IsEmpty())\r
+                       //if (st.GetLastErrorMsg().IsEmpty())\r
                        {\r
                                CMessageBox::Show(hWndExplorer, IDS_ERR_NOPREVREVISION, IDS_APPNAME, MB_ICONERROR);\r
                        }\r
-                       else\r
-                       {\r
-                               CMessageBox::Show(hWndExplorer, IDS_ERR_NOSTATUS, IDS_APPNAME, MB_ICONERROR);\r
-                       }\r
+                       //else\r
+                       //{\r
+                       //      CMessageBox::Show(hWndExplorer, IDS_ERR_NOSTATUS, IDS_APPNAME, MB_ICONERROR);\r
+                       //s}\r
                }\r
        }\r
        return bRet;\r