OSDN Git Service

Show "Merged" status for merged file.
authorFrank Li <lznuaa@gmail.com>
Thu, 14 May 2009 15:02:52 +0000 (23:02 +0800)
committerFrank Li <lznuaa@gmail.com>
Thu, 14 May 2009 15:20:53 +0000 (23:20 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Git/GitStatusListCtrl.h
src/Git/TGitPath.cpp
src/Git/TGitPath.h
src/TortoiseProc/GitLogListBase.cpp

index 7da371a..c51476d 100644 (file)
@@ -61,7 +61,7 @@
 #define SVNSLC_SHOWCONFLICTED  CTGitPath::LOGACTIONS_UNMERGED\r
 #define SVNSLC_SHOWMISSING             0x00000000\r
 #define SVNSLC_SHOWREPLACED            CTGitPath::LOGACTIONS_REPLACED\r
-#define SVNSLC_SHOWMERGED              0x00000000\r
+#define SVNSLC_SHOWMERGED              CTGitPath::LOGACTIONS_MERGED\r
 #define SVNSLC_SHOWIGNORED             CTGitPath::LOGACTIONS_IGNORE\r
 #define SVNSLC_SHOWOBSTRUCTED  0x00000000\r
 #define SVNSLC_SHOWEXTERNAL            0x00000000\r
index ecf5a73..c9dc54c 100644 (file)
@@ -989,7 +989,7 @@ int CTGitPathList::ParserFromLog(BYTE_VECTOR &log)
                if(log[pos]==':')\r
                {\r
                        bool merged=false;\r
-                       if(log[pos+1] ==';')\r
+                       if(log[pos+1] ==':')\r
                        {\r
                                merged=true;\r
                        }\r
@@ -1038,16 +1038,20 @@ int CTGitPathList::ParserFromLog(BYTE_VECTOR &log)
 \r
                        if(GitPath)\r
                        {\r
-                               this->m_Action|=GitPath->ParserAction( log[actionstart] );      \r
-                                                       \r
+                               GitPath->ParserAction( log[actionstart] );      \r
+                               GitPath->m_Action |=merged?CTGitPath::LOGACTIONS_MERGED:0;\r
+                               m_Action |=GitPath->m_Action;\r
+\r
                        }else\r
                        {       \r
                                int ac=path.ParserAction(log[actionstart] );\r
+                               ac |= merged?CTGitPath::LOGACTIONS_MERGED:0;    \r
 \r
                                path.SetFromGit(pathname1,&pathname2);\r
                                path.m_Action=ac;\r
                                        //action must be set after setfromgit. SetFromGit will clear all status. \r
                                this->m_Action|=ac;\r
+                               \r
                                AddPath(path);\r
                                \r
                        }\r
@@ -1906,6 +1910,9 @@ CString CTGitPath::GetActionName(int action)
                return _T("Added");\r
        if(action  & CTGitPath::LOGACTIONS_DELETED)\r
                return _T("Deleted");\r
+       if(action  & CTGitPath::LOGACTIONS_MERGED )\r
+               return _T("Merged");\r
+\r
        if(action  & CTGitPath::LOGACTIONS_MODIFIED)\r
                return _T("Modified");\r
        if(action  & CTGitPath::LOGACTIONS_REPLACED)\r
index 603220c..77f6f35 100644 (file)
@@ -18,6 +18,7 @@ public:
                LOGACTIONS_UNMERGED = 0x00000010,\r
                LOGACTIONS_CACHE        = 0x00000020,\r
                LOGACTIONS_COPY         = 0x00000040,\r
+               LOGACTIONS_MERGED   = 0x00000080,\r
                LOGACTIONS_UNVER        = 0x80000000,\r
                LOGACTIONS_IGNORE       = 0x40000000,\r
                //LOGACTIONS_CONFLICT = 0x20000000,\r
index d861888..3a542f5 100644 (file)
@@ -1630,8 +1630,8 @@ public:
                m_ByteCollector.append(data,size);\r
 \r
                //Find loginfo endmarker\r
-               static const BYTE dataToFind[]={0,0};\r
-               int found=m_ByteCollector.findData(dataToFind,2);\r
+               static const BYTE dataToFind[]={0,0,'#','<'};\r
+               int found=m_ByteCollector.findData(dataToFind,4);\r
                if(found<0)\r
                        return m_ploglist->m_bExitThread;//Not found\r
                found+=2;//Position after loginfo end-marker\r