popupMenu.CreatePopupMenu();\r
\r
bool bAddSeparator = false;\r
+ CString remoteName;\r
+\r
if(selectedLeafs.size()==1)\r
{\r
bAddSeparator = true;\r
\r
- bool bShowReflogOption = false;\r
- bool bShowDeleteBranchOption = false;\r
- bool bShowDeleteTagOption = false;\r
- bool bShowDeleteRemoteBranchOption = false;\r
+ bool bShowReflogOption = false;\r
+ bool bShowDeleteBranchOption = false;\r
+ bool bShowDeleteTagOption = false;\r
+ bool bShowDeleteRemoteBranchOption = false;\r
+ bool bShowFetchOption = false;\r
+\r
+ CString fetchFromCmd;\r
\r
if(selectedLeafs[0]->IsFrom(L"refs/heads"))\r
{\r
{\r
bShowReflogOption = true;\r
bShowDeleteRemoteBranchOption = true;\r
+ bShowFetchOption = true;\r
+\r
+ int dummy = 0;//Needed for tokenize\r
+ remoteName = selectedLeafs[0]->GetRefName();\r
+ remoteName = remoteName.Mid(13);\r
+ remoteName = remoteName.Tokenize(L"/", dummy);\r
+ fetchFromCmd.Format(L"Fetch from %s", remoteName);\r
}\r
else if(selectedLeafs[0]->IsFrom(L"refs/tags"))\r
{\r
\r
popupMenu.AppendMenuIcon(eCmd_ViewLog, L"Show Log", IDI_LOG);\r
if(bShowReflogOption) popupMenu.AppendMenuIcon(eCmd_ShowReflog, L"Show Reflog", IDI_LOG);\r
+ if(bShowFetchOption) popupMenu.AppendMenuIcon(eCmd_Fetch, fetchFromCmd, IDI_PULL);\r
if(bShowDeleteTagOption) popupMenu.AppendMenuIcon(eCmd_DeleteTag, L"Delete Tag", IDI_DELETE);\r
if(bShowDeleteBranchOption) popupMenu.AppendMenuIcon(eCmd_DeleteBranch, L"Delete Branch", IDI_DELETE);\r
if(bShowDeleteRemoteBranchOption) popupMenu.AppendMenuIcon(eCmd_DeleteRemoteBranch, L"Delete Remote Branch", IDI_DELETE);\r
{\r
// popupMenu.AppendMenu(MF_STRING,eCmd_AddRemote,L"Add Remote");\r
popupMenu.AppendMenuIcon(eCmd_ManageRemotes, L"Manage Remotes", IDI_SETTINGS);\r
+ if(selectedLeafs.empty())\r
+ {\r
+ int dummy = 0;//Needed for tokenize\r
+ remoteName = pTree->GetRefName();\r
+ remoteName = remoteName.Mid(13);\r
+ remoteName = remoteName.Tokenize(L"/", dummy);\r
+ if(!remoteName.IsEmpty())\r
+ {\r
+ CString fetchFromCmd;\r
+ fetchFromCmd.Format(L"Fetch from %s", remoteName);\r
+ popupMenu.AppendMenuIcon(eCmd_Fetch, fetchFromCmd, IDI_PULL);\r
+ }\r
+ }\r
}\r
else if(pTree->IsFrom(L"refs/heads"))\r
popupMenu.AppendMenuIcon(eCmd_CreateBranch, L"Create Branch", IDI_COPY);\r
refLogDlg.DoModal();\r
}\r
break;\r
+ case eCmd_Fetch:\r
+ {\r
+ CString cmd;\r
+ cmd.Format(_T("git.exe fetch %s"), remoteName);\r
+ CProgressDlg progress;\r
+ progress.m_GitCmd=cmd;\r
+ progress.DoModal();\r
+ Refresh();\r
+ }\r
+ break;\r
case eCmd_AddRemote:\r
{\r
CAddRemoteDlg(this).DoModal();\r