return _T("Rename");\r
if(m_Action & CTGitPath::LOGACTIONS_COPY)\r
return _T("Copy");\r
+ if(m_Action & CTGitPath::LOGACTIONS_REBASE_EDIT)\r
+ return _T("Edit");\r
+ if(m_Action & CTGitPath::LOGACTIONS_REBASE_SQUASH)\r
+ return _T("Squash");\r
+ if(m_Action & CTGitPath::LOGACTIONS_REBASE_PICK)\r
+ return _T("Pick");\r
\r
return _T("Unknown");\r
}\r
// For log filter only\r
LOGACTIONS_HIDE = 0x20000000,\r
LOGACTIONS_GRAY = 0x10000000,\r
+\r
+ // For Rebase only\r
+ LOGACTIONS_REBASE_CURRENT = 0x08000000,\r
+ LOGACTIONS_REBASE_PICK = 0x04000000,\r
+ LOGACTIONS_REBASE_SQUASH = 0x02000000,\r
+ LOGACTIONS_REBASE_EDIT = 0x01000000,\r
+ LOGACTIONS_REBASE_MASK = 0x0F000000,\r
+ LOGACTIONS_REBASE_MODE_MASK=0x07000000,\r
+\r
};\r
\r
CString m_StatAdd;\r
class CGitLogList : public CGitLogListBase\r
{\r
DECLARE_DYNAMIC(CGitLogList)\r
+protected:\r
+ \r
+ void SetSelectedAction(int action);\r
+\r
public:\r
void ContextMenuAction(int cmd,int FirstSelect, int LastSelect);\r
};
\ No newline at end of file
\r
theApp.DoWaitCursor(1);\r
bool bOpenWith = false;\r
-\r
switch (cmd)\r
{\r
case ID_GNUDIFF1:\r
ReloadHashMap();\r
Invalidate();\r
break;\r
+ case ID_REBASE_PICK:\r
+ SetSelectedAction(CTGitPath::LOGACTIONS_REBASE_PICK);\r
+ break;\r
+ case ID_REBASE_EDIT:\r
+ SetSelectedAction(CTGitPath::LOGACTIONS_REBASE_EDIT);\r
+ break;\r
+ case ID_REBASE_SQUASH:\r
+ SetSelectedAction(CTGitPath::LOGACTIONS_REBASE_SQUASH);\r
+ break;\r
default:\r
//CMessageBox::Show(NULL,_T("Have not implemented"),_T("TortoiseGit"),MB_OK);\r
break;\r
} // switch (cmd)\r
\r
theApp.DoWaitCursor(-1);\r
+}\r
+\r
+void CGitLogList::SetSelectedAction(int action)\r
+{\r
+ POSITION pos = GetFirstSelectedItemPosition();\r
+ int index;\r
+ while(pos)\r
+ {\r
+ index = GetNextSelectedItem(pos);\r
+ ((GitRev*)m_arShownList[index])->m_Action = action;\r
+ CRect rect;\r
+ this->GetItemRect(index,&rect,LVIR_BOUNDS);\r
+ this->InvalidateRect(rect);\r
+\r
+ }\r
+\r
}
\ No newline at end of file
\r
m_bExitThread=FALSE;\r
m_IsOldFirst = FALSE;\r
+ m_IsRebaseReplaceGraph = FALSE;\r
\r
for(int i=0;i<Lanes::COLORS_NUM;i++)\r
{\r
DeleteColumn(c--);\r
temp.LoadString(IDS_LOG_GRAPH);\r
\r
+ if(m_IsRebaseReplaceGraph)\r
+ {\r
+ temp=_T("Rebase");\r
+ }\r
+ else\r
+ {\r
+ temp.LoadString(IDS_LOG_GRAPH);\r
+ }\r
InsertColumn(this->LOGLIST_GRAPH, temp);\r
\r
#if 0 \r
\r
if (pLVCD->iSubItem == LOGLIST_GRAPH)\r
{\r
- if (m_arShownList.GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec)\r
+ if (m_arShownList.GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec && (!this->m_IsRebaseReplaceGraph) )\r
{\r
CRect rect;\r
GetSubItemRect(pLVCD->nmcd.dwItemSpec, pLVCD->iSubItem, LVIR_BOUNDS, rect);\r
case this->LOGLIST_GRAPH: //Graphic\r
if (pLogEntry)\r
{\r
+ if(this->m_IsRebaseReplaceGraph)\r
+ {\r
+ CTGitPath path;\r
+ path.m_Action=pLogEntry->m_Action&CTGitPath::LOGACTIONS_REBASE_MODE_MASK;\r
+\r
+ lstrcpyn(pItem->pszText,path.GetActionName(), pItem->cchTextMax);\r
+ }\r
}\r
break;\r
case this->LOGLIST_ACTION: //action -- no text in the column\r
CIconMenu popup;\r
if (popup.CreatePopupMenu())\r
{\r
+\r
+ if(this->m_IsRebaseReplaceGraph)\r
+ {\r
+ popup.AppendMenuIcon(ID_REBASE_PICK, _T("Pick"), IDI_OPEN);\r
+ popup.AppendMenuIcon(ID_REBASE_SQUASH, _T("Squash"), IDI_OPEN);\r
+ popup.AppendMenuIcon(ID_REBASE_EDIT, _T("Edit"), IDI_OPEN);\r
+ }\r
+\r
if (GetSelectedCount() == 1)\r
{\r
#if 0\r
ID_CREATE_BRANCH,\r
ID_CREATE_TAG,\r
ID_SWITCHTOREV,\r
- ID_RESET\r
+ ID_RESET,\r
+ ID_REBASE_PICK,\r
+ ID_REBASE_EDIT,\r
+ ID_REBASE_SQUASH\r
};\r
void InsertGitColumn();\r
void ResizeAllListCtrlCols();\r
\r
m_CommitList.m_IsIDReplaceAction = TRUE;\r
m_CommitList.m_IsOldFirst = TRUE;\r
+ m_CommitList.m_IsRebaseReplaceGraph = TRUE;\r
\r
m_CommitList.DeleteAllItems();\r
m_CommitList.InsertGitColumn();\r
void CRebaseDlg::OnBnClickedPickAll()\r
{\r
// TODO: Add your control notification handler code here\r
+ this->UpdateData();\r
+ if(this->m_bPickAll)\r
+ this->SetAllRebaseAction(CTGitPath::LOGACTIONS_REBASE_PICK);\r
+\r
+ this->m_bEditAll=FALSE;\r
+ this->m_bSquashAll=FALSE;\r
+ this->UpdateData(FALSE);\r
+ \r
}\r
\r
void CRebaseDlg::OnBnClickedSquashAll()\r
{\r
// TODO: Add your control notification handler code here\r
+ this->UpdateData();\r
+ if(this->m_bSquashAll)\r
+ this->SetAllRebaseAction(CTGitPath::LOGACTIONS_REBASE_SQUASH);\r
+\r
+ this->m_bEditAll=FALSE;\r
+ this->m_bPickAll=FALSE;\r
+ this->UpdateData(FALSE);\r
+\r
}\r
\r
void CRebaseDlg::OnBnClickedEditAll()\r
{\r
// TODO: Add your control notification handler code here\r
+ this->UpdateData();\r
+ if( this->m_bEditAll )\r
+ this->SetAllRebaseAction(CTGitPath::LOGACTIONS_REBASE_EDIT);\r
+\r
+ this->m_bPickAll=FALSE;\r
+ this->m_bSquashAll=FALSE;\r
+ this->UpdateData(FALSE);\r
+\r
+}\r
+\r
+void CRebaseDlg::SetAllRebaseAction(int action)\r
+{\r
+ for(int i=0;i<this->m_CommitList.m_logEntries.size();i++)\r
+ {\r
+ m_CommitList.m_logEntries[i].m_Action=action;\r
+ }\r
+ m_CommitList.Invalidate();\r
}\r
\r
void CRebaseDlg::OnBnClickedRebaseSplit()\r
{\r
+ this->UpdateData();\r
// TODO: Add your control notification handler code here\r
}\r
\r
}\r
}\r
\r
- m_CommitList.Invalidate();\r
-\r
m_tooltips.Pop();\r
AddBranchToolTips(&this->m_BranchCtrl);\r
AddBranchToolTips(&this->m_UpstreamCtrl);\r
\r
+ for(int i=0;i<m_CommitList.m_logEntries.size();i++)\r
+ {\r
+ m_CommitList.m_logEntries[i].m_Action = CTGitPath::LOGACTIONS_REBASE_PICK;\r
+ }\r
+ \r
+ m_CommitList.Invalidate();\r
}\r
\r
void CRebaseDlg::AddBranchToolTips(CHistoryCombo *pBranch)\r
\r
void LoadBranchInfo();\r
void FetchLogList();\r
+ void SetAllRebaseAction(int action);\r
\r
CRect m_DlgOrigRect;\r
CRect m_CommitListOrigRect;\r