OSDN Git Service

Version Tree Basic work
authorFrank Li <lznuaa@gmail.com>
Mon, 5 Jan 2009 13:32:37 +0000 (21:32 +0800)
committerFrank Li <lznuaa@gmail.com>
Mon, 5 Jan 2009 13:32:37 +0000 (21:32 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Git/Git.cpp
src/Git/GitRev.cpp
src/Git/GitRev.h
src/TortoiseProc/GitLogList.cpp
src/TortoiseProc/LogDataVector.cpp
src/TortoiseProc/LogDlgHelper.h
src/TortoiseProc/TortoiseProc.vcproj
src/TortoiseProc/TortoiseProc.vcproj.FSL.B20596.user

index 0c2933e..ca57940 100644 (file)
@@ -181,7 +181,7 @@ int CGit::BuildOutputFormat(CString &format,bool IsFull)
                log.Format(_T("#<%c>%%b%%n"),LOG_REV_COMMIT_BODY);\r
                format += log;\r
        }\r
-       log.Format(_T("#<%c>%%H%%n"),LOG_REV_COMMIT_HASH);\r
+       log.Format(_T("#<%c>%%m%%H%%n"),LOG_REV_COMMIT_HASH);\r
        format += log;\r
        log.Format(_T("#<%c>%%P%%n"),LOG_REV_COMMIT_PARENT);\r
        format += log;\r
@@ -204,7 +204,7 @@ int CGit::GetLog(CString& logOut, CString &hash, int count)
        if(count>0)\r
                num.Format(_T("-n%d"),count);\r
 \r
-       cmd.Format(_T("git.exe log %s -C --numstat --raw --pretty=format:\""),\r
+       cmd.Format(_T("git.exe log %s --left-right --boundary -C --numstat --raw --pretty=format:\""),\r
                                num);\r
        BuildOutputFormat(log);\r
        cmd += log;\r
@@ -222,7 +222,7 @@ int CGit::GetShortLog(CString &logOut,CTGitPath * path, int count)
                n=100;\r
        else\r
                n=count;\r
-       cmd.Format(_T("git.exe log --topo-order -n%d --pretty=format:\""),n);\r
+       cmd.Format(_T("git.exe log --left-right --boundary --topo-order -n%d --pretty=format:\""),n);\r
        BuildOutputFormat(log,false);\r
        cmd += log+_T("\"");\r
        if (path)\r
index 05fb892..0394e26 100644 (file)
@@ -33,6 +33,7 @@ void GitRev::Clear()
        m_Body.Empty();\r
        m_Subject.Empty();\r
        m_CommitHash.Empty();\r
+       m_Mark=0;\r
 \r
 }\r
 int GitRev::CopyFrom(GitRev &rev)\r
@@ -49,6 +50,7 @@ int GitRev::CopyFrom(GitRev &rev)
        m_ParentHash    =rev.m_ParentHash       ;\r
        m_Files                 =rev.m_Files                    ;       \r
        m_Action                =rev.m_Action           ;\r
+       m_Mark                  =rev.m_Mark;\r
        return 0;\r
 }\r
 int GitRev::ParserFromLog(CString &log)\r
@@ -100,10 +102,18 @@ int GitRev::ParserFromLog(CString &log)
                                this->m_Body = text +_T("\n");\r
                                break;\r
                        case LOG_REV_COMMIT_HASH:\r
-                               this->m_CommitHash = text;\r
+                               this->m_CommitHash = text.Right(40);\r
+                               this->m_Mark=text[0];\r
                                break;\r
                        case LOG_REV_COMMIT_PARENT:\r
-                               this->m_ParentHash.insert(this->m_ParentHash.end(),text);\r
+                               while(text.GetLength()>0)\r
+                               {\r
+                                       this->m_ParentHash.insert(this->m_ParentHash.end(),text.Left(40));\r
+                                       if(text.GetLength()>40)\r
+                                               text=text.Right(text.GetLength()-41);\r
+                                       else\r
+                                               break;\r
+                               }\r
                                break;\r
                        case LOG_REV_COMMIT_FILE:\r
                                break;\r
index 3070c8a..84ca319 100644 (file)
@@ -53,7 +53,10 @@ public:
        GIT_REV_LIST m_ParentHash;\r
        CTGitPathList m_Files;\r
        int     m_Action;\r
+       TCHAR m_Mark;\r
        \r
+       BOOL IsBoundary(){return m_Mark == _T('-');}\r
+\r
        void Clear();\r
        int ParserFromLog(CString &log);\r
        CTime ConverFromString(CString input);\r
index 5d2d01d..bd087b0 100644 (file)
@@ -582,7 +582,7 @@ void CGitLogList::paintGraphLane(HDC hdc, int laneHeight,int type, int x1, int x
 void CGitLogList::DrawGraph(HDC hdc,CRect &rect,INT_PTR index)\r
 {\r
        //todo unfinished\r
-       return;\r
+//     return;\r
        GitRev* data = (GitRev*)m_arShownList.GetAt(index);\r
        CRect rt=rect;\r
        LVITEM   rItem;\r
@@ -592,7 +592,7 @@ void CGitLogList::DrawGraph(HDC hdc,CRect &rect,INT_PTR index)
        rItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED;\r
        GetItem(&rItem);\r
 \r
-       static const COLORREF colors[Lanes::COLORS_NUM] = { RGB(0,0,0), RGB(0xFF,0,0), RGB(0,0x1F,0),\r
+       static const COLORREF colors[Lanes::COLORS_NUM] = { RGB(0,0,0), RGB(0xFF,0,0), RGB(0,0xFF,0),\r
                                                   RGB(0,0,0xFF), RGB(128,128,128), RGB(128,128,0),\r
                                                   RGB(0,128,128), RGB(128,0,128) };\r
 \r
index 7852ca5..626fad4 100644 (file)
@@ -144,7 +144,7 @@ int CLogDataVector::ParserFromLog()
 
 void CLogDataVector::setLane(CString& sha) 
 {
-       Lanes* l = &(this->m_Lanes);
+       Lanes* l = &(this->m_Lns);
        int i = m_FirstFreeLane;
        
 //     QVector<QByteArray> ba;
@@ -203,7 +203,7 @@ void CLogDataVector::updateLanes(GitRev& c, Lanes& lns, CString &sha)
        if (isDiscontinuity)
                lns.changeActiveLane(sha); // uses previous isBoundary state
 
-       lns.setBoundary(0/*c.isBoundary()*/); // update must be here
+       lns.setBoundary(c.IsBoundary()); // update must be here
 
        if (isFork)
                lns.setFork(sha);
index 7b53399..0a54a46 100644 (file)
@@ -61,7 +61,7 @@ public:
        int ParserShortLog(CTGitPath *path =NULL,int count = -1  );\r
        int FetchFullInfo(int i);\r
 \r
-       Lanes m_Lanes;\r
+       Lanes m_Lns;\r
        int      m_FirstFreeLane;\r
        MAP_HASH_REV m_HashMap;\r
        void updateLanes(GitRev& c, Lanes& lns, CString &sha) ;\r
index e435791..59d0b88 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\explorer.ico"\r
+                               RelativePath=".\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\explorer.ico"\r
+                               RelativePath="..\Resources\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\newfolder.ico"\r
+                               RelativePath=".\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\newfolder.ico"\r
+                               RelativePath="..\Resources\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\open.ico"\r
+                               RelativePath=".\open.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\open.ico"\r
+                               RelativePath="..\Resources\open.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\save.ico"\r
+                               RelativePath=".\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\save.ico"\r
+                               RelativePath="..\Resources\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\saveas.ico"\r
+                               RelativePath=".\saveas.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\saveas.ico"\r
+                               RelativePath="..\Resources\saveas.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\up.ico"\r
+                               RelativePath=".\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\up.ico"\r
+                               RelativePath="..\Resources\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
index 3408766..a9acb41 100644 (file)
@@ -11,7 +11,7 @@
                        <DebugSettings\r
                                Command="$(TargetPath)"\r
                                WorkingDirectory="D:\Profiles\b20596\tortoisegit"\r
-                               CommandArguments="/command:pull /path:&quot;D:\\Profiles\\b20596\\buildtest\\TortoiseGit&quot;"\r
+                               CommandArguments="/command:log /path:&quot;D:\\Profiles\\b20596\\git&quot;"\r
                                Attach="false"\r
                                DebuggerType="3"\r
                                Remote="1"\r