Rebase cherry pick current branch to upstream.
So it need revert my version and their version at conflict editor
Signed-off-by: Frank Li <lznuaa@gmail.com>
{\r
m_FileLoaded=0;\r
m_critSec.Init();\r
+ m_bIsRevertTheirMy = false;\r
}\r
\r
CGitStatusListCtrl::~CGitStatusListCtrl()\r
\r
case IDSVNLC_EDITCONFLICT:\r
{\r
- CAppUtils::ConflictEdit(*filepath);\r
+ CAppUtils::ConflictEdit(*filepath,false,this->m_bIsRevertTheirMy);\r
break;\r
}\r
case IDSVNLC_RESOLVETHEIRS: //follow up \r
continue;\r
CString gitcmd,output;\r
output.Empty();\r
- if ( cmd == IDSVNLC_RESOLVETHEIRS)\r
+ int stage=0;\r
+ \r
+ if ( ((!this->m_bIsRevertTheirMy)&&cmd == IDSVNLC_RESOLVETHEIRS) ||\r
+ ((this->m_bIsRevertTheirMy)&&cmd == IDSVNLC_RESOLVEMINE) )\r
{\r
gitcmd.Format(_T("git.exe cat-file blob \":3:%s\""),fentry->GetGitPathString());\r
if(g_Git.RunLogFile(gitcmd,(CString&)fentry->GetWinPathString()))\r
}\r
}\r
output.Empty();\r
- if ( cmd == IDSVNLC_RESOLVEMINE)\r
+ if ( ((!this->m_bIsRevertTheirMy)&&cmd == IDSVNLC_RESOLVEMINE) ||\r
+ ((this->m_bIsRevertTheirMy)&&cmd == IDSVNLC_RESOLVETHEIRS) )\r
{\r
gitcmd.Format(_T("git.exe cat-file blob \":2:%s\""),fentry->GetGitPathString());\r
if(g_Git.RunLogFile(gitcmd,(CString&)fentry->GetWinPathString()))\r
\r
if( file->m_Action&CTGitPath::LOGACTIONS_UNMERGED )\r
{\r
- CAppUtils::ConflictEdit(*file,false);\r
+ CAppUtils::ConflictEdit(*file,false,m_bIsRevertTheirMy);\r
\r
}else\r
{\r
\r
CString m_sUUID; ///< the UUID of the associated repository\r
\r
+ BOOL m_bIsRevertTheirMy; ///< at rebase case, Their and My version is revert. \r
+\r
DECLARE_MESSAGE_MAP()\r
\r
private:\r
return file;\r
}\r
\r
-bool CAppUtils::ConflictEdit(CTGitPath &path,bool bAlternativeTool)\r
+bool CAppUtils::ConflictEdit(CTGitPath &path,bool bAlternativeTool,bool revertTheirMy)\r
{\r
bool bRet = false;\r
\r
if(b_local && b_remote )\r
{\r
merge.SetFromWin(g_Git.m_CurrentDir+_T("\\")+merge.GetWinPathString());\r
- bRet = !!CAppUtils::StartExtMerge(base, theirs, mine, merge,_T("BASE"),_T("REMOTE"),_T("LOCAL"));\r
+ if( revertTheirMy )\r
+ bRet = !!CAppUtils::StartExtMerge(base,mine, theirs, merge,_T("BASE"),_T("LOCAL"),_T("REMOTE"));\r
+ else\r
+ bRet = !!CAppUtils::StartExtMerge(base, theirs, mine, merge,_T("BASE"),_T("REMOTE"),_T("LOCAL"));\r
\r
}else\r
{\r
// static bool IgnoreFile(CTGitPath &file, bool IsMask);\r
static bool IgnoreFile(CTGitPathList &filelist,bool IsMask);\r
static bool GitReset(CString *CommitHash,int type=1);\r
- static bool ConflictEdit(CTGitPath &file,bool bAlternativeTool=false);\r
+ static bool ConflictEdit(CTGitPath &file,bool bAlternativeTool=false,bool revertTheirMy=false);\r
/**\r
* FUNCTION : FormatDateAndTime\r
* DESCRIPTION : Generates a displayable string from a CTime object in\r
int CRebaseDlg::StartRebase()\r
{\r
CString cmd,out;\r
-\r
+ m_FileListCtrl.m_bIsRevertTheirMy = !m_IsCherryPick;\r
if(!this->m_IsCherryPick)\r
{\r
//Todo call comment_for_reflog\r
CTGitPath path;\r
list.AddPath(path);\r
\r
+ m_FileListCtrl.m_bIsRevertTheirMy = !m_IsCherryPick;\r
+\r
this->m_FileListCtrl.GetStatus(&list,true);\r
this->m_FileListCtrl.Show(CTGitPath::LOGACTIONS_UNMERGED|CTGitPath::LOGACTIONS_MODIFIED|CTGitPath::LOGACTIONS_ADDED|CTGitPath::LOGACTIONS_DELETED,\r
CTGitPath::LOGACTIONS_UNMERGED);\r