return memcmp(left.m_hash, right.m_hash, GIT_HASH_SIZE) > 0;\r
}\r
\r
+ friend bool operator != (const CGitHash& left, const CGitHash& right)\r
+ {\r
+ return memcmp(left.m_hash, right.m_hash, GIT_HASH_SIZE) != 0;\r
+ }\r
#if defined(_MFC_VER)\r
friend CArchive& AFXAPI operator<<(CArchive& ar, CGitHash& hash)\r
{\r
CString parentsubject;\r
int index;\r
\r
- if( pLogEntry->m_HashMap.find(rev->m_ParentHash[i]) == pLogEntry->m_HashMap.end() )\r
+ GitRev *p =NULL;\r
+ \r
+ if( pLogEntry->m_pLogCache->m_HashMap.find(rev->m_ParentHash[i]) == pLogEntry->m_pLogCache->m_HashMap.end())\r
{ \r
- index = -1;\r
+ p=NULL;\r
}\r
else\r
{\r
- index=pLogEntry->m_HashMap[rev->m_ParentHash[i]];\r
+ p= &pLogEntry->m_pLogCache->m_HashMap[rev->m_ParentHash[i]] ;\r
}\r
- if(index>=0)\r
- parentsubject=pLogEntry->GetGitRevAt(index).m_Subject;\r
+ if(p)\r
+ parentsubject=p->m_Subject;\r
\r
str.Format(_T("%d - %s \n %s"),i,rev->m_ParentHash[i].ToString(),parentsubject);\r
\r
- CMFCPropertyGridProperty*p=new CMFCPropertyGridProperty(\r
+ CMFCPropertyGridProperty*pProtery=new CMFCPropertyGridProperty(\r
rev->m_ParentHash[i].ToString().Left(8), \r
parentsubject,\r
str\r
);\r
- m_ParentGroup->AddSubItem(p);\r
+ m_ParentGroup->AddSubItem(pProtery);\r
m_ParentGroup->Expand();\r
}\r
for(int i=0;i<m_BaseInfoGroup->GetSubItemsCount();i++)\r
oldfont = (HFONT)::SelectObject(hDC, m_font);\r
::SetBkColor(hDC, m_windowcolor);\r
::SetTextColor(hDC, m_textcolor);\r
- if (m_CommitHash[i].GetLength()>0)\r
+ if (!m_CommitHash[i].IsEmpty())\r
{\r
//if (m_CommitHash[i].Compare(m_MouseHash)==0)\r
// ::SetBkColor(hDC, m_mouseauthorcolor);\r
- if (m_CommitHash[i].Compare(m_SelectedHash)==0)\r
+ if (m_CommitHash[i] == m_SelectedHash )\r
{\r
::SetBkColor(hDC, m_selectedauthorcolor);\r
::SetTextColor(hDC, m_texthighlightcolor);\r
int i;\r
for(i=0;i<m_CommitHash.size();i++)\r
{\r
- if( pRev->m_CommitHash.ToString() == m_CommitHash[i] )\r
+ if( pRev->m_CommitHash == m_CommitHash[i] )\r
break;\r
}\r
this->GotoLine(i);\r
FindNextLine(this->m_SelectedHash,true);\r
}\r
\r
-int CTortoiseGitBlameView::FindNextLine(CString CommitHash,bool bUpOrDown)\r
+int CTortoiseGitBlameView::FindNextLine(CGitHash CommitHash,bool bUpOrDown)\r
{\r
LONG_PTR line = SendEditor(SCI_GETFIRSTVISIBLELINE);\r
LONG_PTR startline =line;\r
afx_msg void OnViewNext();\r
afx_msg void OnViewPrev();\r
\r
- int FindNextLine(CString commithash, bool bUpOrDown=false);\r
- int FindFirstLine(CString commithash, int line)\r
+ int FindNextLine(CGitHash commithash, bool bUpOrDown=false);\r
+ int FindFirstLine(CGitHash commithash, int line)\r
{\r
while(line>=0)\r
{\r
LONG m_MouseLine;\r
LONG m_selectedrev;\r
LONG m_selectedorigrev;\r
- CString m_SelectedHash;\r
- CString m_selecteddate;\r
+ CGitHash m_SelectedHash;\r
+ CGitHash m_selecteddate;\r
static long m_gotoline;\r
long m_lowestrev;\r
long m_highestrev;\r
// std::vector<LONG> m_Origrevs;\r
std::vector<CString> m_Dates;\r
std::vector<CString> m_Authors;\r
- std::vector<CString> m_CommitHash;\r
+ std::vector<CGitHash> m_CommitHash;\r
\r
std::map<CString,GitRev> m_NoListCommit;\r
\r
pRev->m_Files.Clear();\r
pRev->m_ParentHash.clear();\r
pRev->m_ParentHash.push_back(m_HeadHash);\r
- g_Git.GetCommitDiffList(pRev->m_CommitHash.ToString(),this->m_HeadHash, pRev->m_Files);\r
+ g_Git.GetCommitDiffList(pRev->m_CommitHash.ToString(),this->m_HeadHash.ToString(), pRev->m_Files);\r
pRev->m_Action =0;\r
\r
for(int j=0;j< pRev->m_Files.GetCount();j++)\r
CColors m_Colors;\r
\r
CString m_CurrentBranch;\r
- CString m_HeadHash;\r
+ CGitHash m_HeadHash;\r
\r
CString m_StartRef; //Ref of the top-commit\r
\r
BYTE_VECTOR log;\r
GitRev rev;\r
CString emptyhash;\r
+ this->m_pLogCache->ClearAllParent();\r
+\r
g_Git.GetLog(log,emptyhash,path,count,infomask,from,to);\r
\r
CString begin;\r