Signed-off-by: Frank Li <lznuaa@gmail.com>
\r
if (m_dwContextMenus & this->GetContextMenuBit(IDSVNLC_COMPAREWC))\r
{\r
\r
if (m_dwContextMenus & this->GetContextMenuBit(IDSVNLC_COMPAREWC))\r
{\r
- popup.AppendMenuIcon(IDSVNLC_COMPAREWC, IDS_LOG_POPUP_COMPARE, IDI_DIFF);\r
+ if( (!m_CurrentVersion.IsEmpty()) && m_CurrentVersion != GIT_REV_ZERO)\r
+ popup.AppendMenuIcon(IDSVNLC_COMPAREWC, IDS_LOG_POPUP_COMPARE, IDI_DIFF);\r
}\r
//Select one items\r
if (GetSelectedCount() == 1)\r
}\r
//Select one items\r
if (GetSelectedCount() == 1)\r
ShellExecute(this->m_hWnd, _T("explore"), filepath->GetDirectory().GetWinPath(), NULL, NULL, SW_SHOW);\r
}\r
break;\r
ShellExecute(this->m_hWnd, _T("explore"), filepath->GetDirectory().GetWinPath(), NULL, NULL, SW_SHOW);\r
}\r
break;\r
+\r
+ // Compare current version and work copy. \r
+ case IDSVNLC_COMPAREWC:\r
+ {\r
+ POSITION pos = GetFirstSelectedItemPosition();\r
+ while ( pos )\r
+ {\r
+ int index = GetNextSelectedItem(pos);\r
+ StartDiffWC(index);\r
+ }\r
+ }\r
+ break;\r
+ // Compare with base version. when current version is zero, compare workcopy and HEAD. \r
case IDSVNLC_COMPARE:\r
{\r
POSITION pos = GetFirstSelectedItemPosition();\r
case IDSVNLC_COMPARE:\r
{\r
POSITION pos = GetFirstSelectedItemPosition();\r
+void CGitStatusListCtrl::StartDiffWC(int fileindex)\r
+{\r
+ if(fileindex<0)\r
+ return;\r
+\r
+ CString Ver;\r
+ if(this->m_CurrentVersion.IsEmpty() || m_CurrentVersion== GIT_REV_ZERO)\r
+ return;\r
+\r
+ CTGitPath file1=*(CTGitPath*)GetItemData(fileindex);\r
+\r
+ CGitDiff::Diff(&file1,&file1,\r
+ CString(GIT_REV_ZERO),\r
+ m_CurrentVersion);\r
+\r
+}\r
\r
void CGitStatusListCtrl::StartDiff(int fileindex)\r
{\r
\r
void CGitStatusListCtrl::StartDiff(int fileindex)\r
{\r
void RemoveListEntry(int index); ///< removes an entry from the listcontrol and both arrays\r
bool BuildStatistics(); ///< build the statistics and correct the case of files/folders\r
void StartDiff(int fileindex); ///< start the external diff program\r
void RemoveListEntry(int index); ///< removes an entry from the listcontrol and both arrays\r
bool BuildStatistics(); ///< build the statistics and correct the case of files/folders\r
void StartDiff(int fileindex); ///< start the external diff program\r
+ void StartDiffWC(int fileindex); ///< start the external diff program\r
\r
/// fetch all user properties for all items\r
void FetchUserProperties();\r
\r
/// fetch all user properties for all items\r
void FetchUserProperties();\r