Fixed issue #1076: Error trying to delete remote branch named 1.0.0
[TortoiseGit.git] / src / TortoiseProc / PushDlg.cpp
blob9cd78fa3e3ea307d62dd40b66e98f679c4206313
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2012 - TortoiseGit
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // PushDlg.cpp : implementation file
23 #include "stdafx.h"
24 #include "TortoiseProc.h"
25 #include "PushDlg.h"
27 #include "Git.h"
28 #include "registry.h"
29 #include "AppUtils.h"
30 #include "LogDlg.h"
31 #include "BrowseRefsDlg.h"
32 #include "RefLogDlg.h"
33 #include "MessageBox.h"
35 // CPushDlg dialog
37 IMPLEMENT_DYNAMIC(CPushDlg, CHorizontalResizableStandAloneDialog)
39 CPushDlg::CPushDlg(CWnd* pParent /*=NULL*/)
40 : CHorizontalResizableStandAloneDialog(CPushDlg::IDD, pParent)
41 , m_bPushAllBranches(FALSE)
42 , m_bForce(FALSE)
43 , m_bPack(FALSE)
44 , m_bTags(FALSE)
45 , m_bAutoLoad(FALSE)
46 , m_bPushAllRemotes(FALSE)
47 , m_bSetPushBranch(FALSE)
48 , m_bSetPushRemote(FALSE)
49 , m_bSetUpstream(FALSE)
51 m_bAutoLoad = CAppUtils::IsSSHPutty();
54 CPushDlg::~CPushDlg()
58 void CPushDlg::DoDataExchange(CDataExchange* pDX)
60 CHorizontalResizableStandAloneDialog::DoDataExchange(pDX);
61 DDX_Control(pDX, IDC_BRANCH_REMOTE, this->m_BranchRemote);
62 DDX_Control(pDX, IDC_BRANCH_SOURCE, this->m_BranchSource);
63 DDX_Control(pDX, IDC_REMOTE, this->m_Remote);
64 DDX_Control(pDX, IDC_URL, this->m_RemoteURL);
65 DDX_Control(pDX, IDC_BUTTON_BROWSE_SOURCE_BRANCH, m_BrowseLocalRef);
66 DDX_Check(pDX,IDC_FORCE,this->m_bForce);
67 DDX_Check(pDX,IDC_PUSHALL,this->m_bPushAllBranches);
68 DDX_Check(pDX,IDC_PACK,this->m_bPack);
69 DDX_Check(pDX,IDC_TAGS,this->m_bTags);
70 DDX_Check(pDX,IDC_PUTTYKEY_AUTOLOAD,this->m_bAutoLoad);
71 DDX_Check(pDX, IDC_PROC_PUSH_SET_PUSHREMOTE, m_bSetPushRemote);
72 DDX_Check(pDX, IDC_PROC_PUSH_SET_PUSHBRANCH, m_bSetPushBranch);
73 DDX_Check(pDX, IDC_PROC_PUSH_SET_UPSTREAM, m_bSetUpstream);
76 BEGIN_MESSAGE_MAP(CPushDlg, CHorizontalResizableStandAloneDialog)
77 ON_BN_CLICKED(IDC_RD_REMOTE, &CPushDlg::OnBnClickedRd)
78 ON_BN_CLICKED(IDC_RD_URL, &CPushDlg::OnBnClickedRd)
79 ON_CBN_SELCHANGE(IDC_BRANCH_SOURCE, &CPushDlg::OnCbnSelchangeBranchSource)
80 ON_CBN_SELCHANGE(IDC_REMOTE, &CPushDlg::EnDisablePushRemoteArchiveBranch)
81 ON_BN_CLICKED(IDOK, &CPushDlg::OnBnClickedOk)
82 ON_BN_CLICKED(IDC_REMOTE_MANAGE, &CPushDlg::OnBnClickedRemoteManage)
83 ON_BN_CLICKED(IDC_BUTTON_BROWSE_SOURCE_BRANCH, &CPushDlg::OnBnClickedButtonBrowseSourceBranch)
84 ON_BN_CLICKED(IDC_BUTTON_BROWSE_DEST_BRANCH, &CPushDlg::OnBnClickedButtonBrowseDestBranch)
85 ON_BN_CLICKED(IDC_PUSHALL, &CPushDlg::OnBnClickedPushall)
86 ON_BN_CLICKED(IDC_PROC_PUSH_SET_UPSTREAM, &CPushDlg::OnBnClickedProcPushSetUpstream)
87 ON_BN_CLICKED(IDC_PROC_PUSH_SET_PUSHREMOTE, &CPushDlg::OnBnClickedProcPushSetPushremote)
88 ON_BN_CLICKED(IDC_PROC_PUSH_SET_PUSHBRANCH, &CPushDlg::OnBnClickedProcPushSetPushremote)
89 END_MESSAGE_MAP()
91 BOOL CPushDlg::OnInitDialog()
93 CHorizontalResizableStandAloneDialog::OnInitDialog();
94 CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
96 AddAnchor(IDOK,BOTTOM_RIGHT);
97 AddAnchor(IDCANCEL,BOTTOM_RIGHT);
98 AddAnchor(IDC_BRANCH_GROUP, TOP_LEFT,TOP_RIGHT);
99 AddAnchor(IDC_STATIC_REMOTE, TOP_LEFT);
100 AddAnchor(IDC_STATIC_SOURCE, TOP_LEFT);
102 AddAnchor(IDC_PUSHALL, TOP_LEFT);
103 AddAnchor(IDC_BRANCH_REMOTE, TOP_LEFT, TOP_RIGHT);
104 AddAnchor(IDC_BUTTON_BROWSE_DEST_BRANCH, TOP_RIGHT);
105 AddAnchor(IDC_BRANCH_SOURCE, TOP_LEFT, TOP_RIGHT);
106 AddAnchor(IDC_BUTTON_BROWSE_SOURCE_BRANCH, TOP_RIGHT);
108 AddAnchor(IDC_URL_GROUP, TOP_LEFT,TOP_RIGHT);
109 AddAnchor(IDC_RD_REMOTE, TOP_LEFT);
110 AddAnchor(IDC_RD_URL, TOP_LEFT);
112 AddAnchor(IDC_REMOTE, TOP_LEFT, TOP_RIGHT);
114 AddAnchor(IDC_URL, TOP_LEFT,TOP_RIGHT);
116 AddAnchor(IDC_OPTION_GROUP, TOP_LEFT,TOP_RIGHT);
118 AddAnchor(IDC_FORCE, TOP_LEFT);
119 AddAnchor(IDC_PACK, TOP_LEFT);
120 AddAnchor(IDC_TAGS, TOP_LEFT);
121 AddAnchor(IDC_PUTTYKEY_AUTOLOAD,TOP_LEFT);
122 AddAnchor(IDC_PROC_PUSH_SET_PUSHBRANCH, TOP_LEFT);
123 AddAnchor(IDC_PROC_PUSH_SET_PUSHREMOTE, TOP_LEFT);
124 AddAnchor(IDC_PROC_PUSH_SET_UPSTREAM, TOP_LEFT);
126 AddAnchor(IDC_REMOTE_MANAGE,TOP_RIGHT);
127 AddAnchor(IDHELP, BOTTOM_RIGHT);
129 AddOthersToAnchor();
131 AdjustControlSize(IDC_RD_REMOTE);
132 AdjustControlSize(IDC_RD_URL);
133 AdjustControlSize(IDC_PUSHALL);
134 AdjustControlSize(IDC_FORCE);
135 AdjustControlSize(IDC_PACK);
136 AdjustControlSize(IDC_TAGS);
137 AdjustControlSize(IDC_PUTTYKEY_AUTOLOAD);
138 AdjustControlSize(IDC_PROC_PUSH_SET_PUSHBRANCH);
139 AdjustControlSize(IDC_PROC_PUSH_SET_PUSHREMOTE);
140 AdjustControlSize(IDC_PROC_PUSH_SET_UPSTREAM);
142 CString sWindowTitle;
143 GetWindowText(sWindowTitle);
144 CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle);
146 this->GetDlgItem(IDC_PUTTYKEY_AUTOLOAD)->EnableWindow(CAppUtils::IsSSHPutty());
148 EnableSaveRestore(_T("PushDlg"));
150 m_RemoteURL.SetURLHistory(TRUE);
152 CString WorkingDir=g_Git.m_CurrentDir;
153 WorkingDir.Replace(_T(':'),_T('_'));
154 m_RemoteURL.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\PushURLS\\"))+WorkingDir, _T("url"));
155 CString clippath=CAppUtils::GetClipboardLink();
156 if(clippath.IsEmpty())
157 m_RemoteURL.SetCurSel(0);
158 else
159 m_RemoteURL.SetWindowText(clippath);
161 m_RemoteURL.EnableWindow(FALSE);
162 CheckRadioButton(IDC_RD_REMOTE,IDC_RD_URL,IDC_RD_REMOTE);
165 this->m_regAutoLoad = CRegDWORD(CString(_T("Software\\TortoiseGit\\History\\PushDlgAutoLoad\\"))+WorkingDir,
166 m_bAutoLoad);
167 m_bAutoLoad = this->m_regAutoLoad;
168 if(!CAppUtils::IsSSHPutty())
169 m_bAutoLoad = false;
171 m_BrowseLocalRef.m_bRightArrow = TRUE;
172 m_BrowseLocalRef.m_bDefaultClick = FALSE;
173 m_BrowseLocalRef.m_bMarkDefault = FALSE;
174 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_REFBROWSE)));
175 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_LOG)));
176 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_REFLOG)));
178 m_tooltips.Create(this);
179 m_tooltips.AddTool(IDC_PROC_PUSH_SET_PUSHBRANCH, IDS_PUSHDLG_PUSHBRANCH_TT);
180 m_tooltips.AddTool(IDC_PROC_PUSH_SET_PUSHREMOTE, IDS_PUSHDLG_PUSHREMOTE_TT);
182 Refresh();
184 this->UpdateData(false);
185 return TRUE;
188 void CPushDlg::Refresh()
190 CString WorkingDir=g_Git.m_CurrentDir;
191 WorkingDir.Replace(_T(':'),_T('_'));
193 CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));
194 m_RemoteReg = remote;
195 int sel = -1;
197 STRING_VECTOR list;
198 m_Remote.Reset();
200 list.push_back(CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)));
201 if(!g_Git.GetRemoteList(list))
203 if (list.size() <= 2)
204 list.erase(list.begin());
206 for(unsigned int i=0;i<list.size();i++)
208 m_Remote.AddString(list[i]);
209 if(list[i] == remote)
210 sel = i;
213 // if the last selected remote was "- All -" and "- All -" is still in the list -> select it
214 if (list.size() > 1 && remote == CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)))
215 sel = 0;
216 m_Remote.SetCurSel(sel);
218 int current=0;
219 list.clear();
220 m_BranchSource.Reset();
221 m_BranchSource.AddString(_T(" ")); // empty string does not work, for removal of remote branches/tags
222 m_BranchSource.SetMaxHistoryItems(0x7FFFFFFF);
223 if(!g_Git.GetBranchList(list,&current))
225 for(unsigned int i=0;i<list.size();i++)
226 m_BranchSource.AddString(list[i]);
227 current++; // shift for " "
229 if (wcsncmp(m_BranchSourceName, _T("refs/"), 5) == 0)
230 m_BranchSourceName = m_BranchSourceName.Mid(5);
231 if (wcsncmp(m_BranchSourceName, _T("heads/"), 6) == 0)
233 m_BranchSourceName = m_BranchSourceName.Mid(6);
234 m_BranchSource.SetCurSel(m_BranchSource.FindStringExact(-1, m_BranchSourceName));
236 else if (wcsncmp(m_BranchSourceName, _T("remotes/"), 8) == 0)
237 m_BranchSource.SetCurSel(m_BranchSource.FindStringExact(-1, m_BranchSourceName));
238 else
239 m_BranchSource.SetCurSel(current);
241 GetRemoteBranch(m_BranchSource.GetString());
243 this->GetDlgItem(IDOK)->EnableWindow(m_BranchSource.GetCount() != 0);
246 void CPushDlg::GetRemoteBranch(CString currentBranch)
248 CString WorkingDir=g_Git.m_CurrentDir;
249 WorkingDir.Replace(_T(':'), _T('_'));
251 if (currentBranch.IsEmpty())
253 EnDisablePushRemoteArchiveBranch();
254 return;
257 CString configName;
259 configName.Format(L"branch.%s.pushremote", currentBranch);
260 CString pushRemote = g_Git.GetConfigValue(configName);
261 if( pushRemote.IsEmpty() )
263 configName.Format(L"branch.%s.remote", currentBranch);
264 pushRemote = g_Git.GetConfigValue(configName);
267 CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));
269 if (!pushRemote.IsEmpty())
271 remote = pushRemote;
272 // if a pushRemote exists, select it
273 for (int i = 0; i < m_Remote.GetCount(); i++)
275 CString str;
276 int n = m_Remote.GetLBTextLen(i);
277 m_Remote.GetLBText(i, str.GetBuffer(n));
278 str.ReleaseBuffer();
279 if (str == pushRemote)
281 m_Remote.SetCurSel(i);
282 break;
286 // select no remote if no push-remote is specified AND push to all remotes is not selected
287 else if (!(m_Remote.GetCount() > 1 && m_Remote.GetCurSel() == 0))
289 m_Remote.SetCurSel(-1);
292 //Select pull-branch from current branch
293 configName.Format(L"branch.%s.pushbranch", currentBranch);
294 CString pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
295 if( pushBranch.IsEmpty() )
297 configName.Format(L"branch.%s.merge", currentBranch);
298 pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
301 m_BranchRemote.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\RemoteBranch\\"))+WorkingDir, _T("branch"));
302 if( !pushBranch.IsEmpty() )
303 m_BranchRemote.AddString(pushBranch);
305 EnDisablePushRemoteArchiveBranch();
308 void CPushDlg::EnDisablePushRemoteArchiveBranch()
310 if ((m_Remote.GetCount() > 1 && m_Remote.GetCurSel() == 0) || m_bPushAllBranches || GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL || m_BranchSource.GetString().Trim().IsEmpty())
312 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHBRANCH, FALSE);
313 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHREMOTE, FALSE);
314 bool enableUpstream = (GetCheckedRadioButton(IDC_RD_REMOTE, IDC_RD_URL) != IDC_RD_URL && (!m_BranchSource.GetString().Trim().IsEmpty() || m_bPushAllBranches));
315 DialogEnableWindow(IDC_PROC_PUSH_SET_UPSTREAM, enableUpstream);
316 if (m_bSetUpstream && !enableUpstream)
317 m_bSetUpstream = FALSE;
318 m_bSetPushRemote = FALSE;
319 m_bSetPushBranch = FALSE;
320 UpdateData(FALSE);
322 else
324 DialogEnableWindow(IDC_PROC_PUSH_SET_UPSTREAM, TRUE);
325 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHBRANCH, !m_bSetUpstream);
326 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHREMOTE, !m_bSetUpstream);
330 // CPushDlg message handlers
332 void CPushDlg::OnBnClickedRd()
334 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_REMOTE)
336 m_Remote.EnableWindow(TRUE);
337 GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(TRUE);
338 m_RemoteURL.EnableWindow(FALSE);
340 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL)
342 m_Remote.EnableWindow(FALSE);
343 GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(FALSE);
344 m_RemoteURL.EnableWindow(TRUE);
346 EnDisablePushRemoteArchiveBranch();
350 void CPushDlg::OnCbnSelchangeBranchSource()
352 GetRemoteBranch(m_BranchSource.GetString());
355 void CPushDlg::OnBnClickedOk()
357 CHorizontalResizableStandAloneDialog::UpdateData(TRUE);
359 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_REMOTE)
361 m_URL=m_Remote.GetString();
362 if (m_URL.IsEmpty())
364 CMessageBox::Show(NULL, IDS_PROC_GITCONFIG_REMOTEEMPTY, IDS_APPNAME, MB_OK);
365 return;
367 m_bPushAllRemotes = (m_Remote.GetCurSel() == 0 && m_Remote.GetCount() > 1);
369 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL)
371 m_URL=m_RemoteURL.GetString();
374 if (!m_bPushAllBranches)
376 this->m_BranchRemoteName=m_BranchRemote.GetString().Trim();
377 this->m_BranchSourceName=m_BranchSource.GetString().Trim();
379 if (m_BranchSourceName.IsEmpty() && m_BranchRemoteName.IsEmpty())
381 if (CMessageBox::Show(NULL, IDS_B_T_BOTHEMPTY, IDS_APPNAME, MB_ICONQUESTION | MB_YESNO) == IDNO)
382 return;
384 if (m_BranchSourceName.IsEmpty() && !m_BranchRemoteName.IsEmpty())
386 if (CMessageBox::Show(NULL, IDS_B_T_LOCALEMPTY, IDS_APPNAME, MB_ICONEXCLAMATION | MB_YESNO) == IDNO)
387 return;
389 else if (!m_BranchRemoteName.IsEmpty() && !g_Git.IsBranchNameValid(this->m_BranchRemoteName))
391 CMessageBox::Show(NULL, IDS_B_T_INVALID, IDS_APPNAME, MB_OK);
392 return;
394 else if (!m_BranchSourceName.IsEmpty() && !g_Git.IsBranchTagNameUnique(m_BranchSourceName))
396 CMessageBox::Show(NULL, IDS_B_T_NOT_UNIQUE, IDS_APPNAME, MB_OK | MB_ICONEXCLAMATION);
397 return;
399 else
401 // do not store branch names on removal
402 this->m_RemoteURL.SaveHistory();
403 this->m_BranchRemote.SaveHistory();
404 m_RemoteReg = m_Remote.GetString();
406 if (!m_BranchSourceName.IsEmpty())
408 CString configName;
409 if (m_bSetPushBranch)
411 configName.Format(L"branch.%s.pushbranch", m_BranchSourceName);
412 if (!m_BranchRemoteName.IsEmpty())
413 g_Git.SetConfigValue(configName, m_BranchRemoteName);
414 else
415 g_Git.UnsetConfigValue(configName);
417 if (m_bSetPushRemote)
419 configName.Format(L"branch.%s.pushremote", m_BranchSourceName);
420 if (!m_URL.IsEmpty())
421 g_Git.SetConfigValue(configName, m_URL);
422 else
423 g_Git.UnsetConfigValue(configName);
429 this->m_regAutoLoad = m_bAutoLoad ;
431 CHorizontalResizableStandAloneDialog::OnOK();
434 void CPushDlg::OnBnClickedRemoteManage()
436 CAppUtils::LaunchRemoteSetting();
437 Refresh();
440 void CPushDlg::OnBnClickedButtonBrowseSourceBranch()
442 switch (m_BrowseLocalRef.GetCurrentEntry())
444 case 0: /* Browse Refence*/
446 if(CBrowseRefsDlg::PickRefForCombo(&m_BranchSource, gPickRef_Head))
447 OnCbnSelchangeBranchSource();
449 break;
451 case 1: /* Log */
453 CLogDlg dlg;
454 dlg.SetSelect(true);
455 if(dlg.DoModal() == IDOK)
457 if (dlg.GetSelectedHash().IsEmpty())
458 return;
460 m_BranchSource.SetWindowText(dlg.GetSelectedHash());
461 OnCbnSelchangeBranchSource();
464 break;
466 case 2: /*RefLog*/
468 CRefLogDlg dlg;
469 if(dlg.DoModal() == IDOK)
471 m_BranchSource.SetWindowText(dlg.m_SelectedHash);
472 OnCbnSelchangeBranchSource();
475 break;
479 void CPushDlg::OnBnClickedButtonBrowseDestBranch()
481 CString remoteBranchName;
482 CString remoteName;
483 m_BranchRemote.GetWindowText(remoteBranchName);
484 remoteName = m_Remote.GetString();
485 remoteBranchName = remoteName + '/' + remoteBranchName;
486 remoteBranchName = CBrowseRefsDlg::PickRef(false, remoteBranchName, gPickRef_Remote);
487 if(remoteBranchName.IsEmpty())
488 return; //Canceled
489 remoteBranchName = remoteBranchName.Mid(13);//Strip 'refs/remotes/'
490 int slashPlace = remoteBranchName.Find('/');
491 remoteName = remoteBranchName.Left(slashPlace);
492 remoteBranchName = remoteBranchName.Mid(slashPlace + 1); //Strip remote name (for example 'origin/')
494 //Select remote
495 int remoteSel = m_Remote.FindStringExact(0,remoteName);
496 if(remoteSel >= 0)
497 m_Remote.SetCurSel(remoteSel);
499 //Select branch
500 m_BranchRemote.AddString(remoteBranchName);
503 BOOL CPushDlg::PreTranslateMessage(MSG* pMsg)
505 m_tooltips.RelayEvent(pMsg);
507 if (pMsg->message == WM_KEYDOWN)
509 switch (pMsg->wParam)
511 case VK_F5:
513 Refresh();
515 break;
519 return CHorizontalResizableStandAloneDialog::PreTranslateMessage(pMsg);
522 void CPushDlg::OnBnClickedPushall()
524 this->UpdateData();
525 this->GetDlgItem(IDC_BRANCH_REMOTE)->EnableWindow(!m_bPushAllBranches);
526 this->GetDlgItem(IDC_BRANCH_SOURCE)->EnableWindow(!m_bPushAllBranches);
527 this->GetDlgItem(IDC_BUTTON_BROWSE_SOURCE_BRANCH)->EnableWindow(!m_bPushAllBranches);
528 this->GetDlgItem(IDC_BUTTON_BROWSE_DEST_BRANCH)->EnableWindow(!m_bPushAllBranches);
529 this->GetDlgItem(IDC_TAGS)->EnableWindow(!m_bPushAllBranches);
530 if (m_bTags && m_bPushAllBranches)
532 m_bTags = FALSE;
533 UpdateData(FALSE);
535 EnDisablePushRemoteArchiveBranch();
538 void CPushDlg::OnBnClickedProcPushSetUpstream()
540 UpdateData();
541 this->GetDlgItem(IDC_PROC_PUSH_SET_PUSHREMOTE)->EnableWindow(!m_bSetUpstream);
542 this->GetDlgItem(IDC_PROC_PUSH_SET_PUSHBRANCH)->EnableWindow(!m_bSetUpstream);
543 m_bSetPushBranch = FALSE;
544 m_bSetPushRemote = FALSE;
545 UpdateData(FALSE);
548 void CPushDlg::OnBnClickedProcPushSetPushremote()
550 UpdateData();
551 this->GetDlgItem(IDC_PROC_PUSH_SET_UPSTREAM)->EnableWindow(!(m_bSetPushBranch || m_bSetPushRemote));
552 m_bSetUpstream = FALSE;
553 UpdateData(FALSE);