OSDN Git Service

Add remote branch name at pull\fetch dialog.
authorFrank Li <lznuaa@gmail.com>
Sat, 3 Jan 2009 09:31:14 +0000 (17:31 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 3 Jan 2009 09:31:14 +0000 (17:31 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/Commands/FetchCommand.cpp
src/TortoiseProc/Commands/PullCommand.cpp
src/TortoiseProc/PullFetchDlg.cpp
src/TortoiseProc/PullFetchDlg.h
src/TortoiseProc/TortoiseProc.vcproj.FSL.B20596.user
src/TortoiseProc/resource.h

index fbd0ef3..46b363b 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 6f43057..e6bbfb9 100644 (file)
@@ -36,7 +36,7 @@ bool FetchCommand::Execute()
                CString url;\r
                url=dlg.m_RemoteURL;\r
                CString cmd;\r
-               cmd.Format(_T("git.exe fetch \"%s\""),url);\r
+               cmd.Format(_T("git.exe fetch \"%s\" %s"),url, dlg.m_RemoteBranchName);\r
                CProgressDlg progress;\r
                progress.m_GitCmd=cmd;\r
                if(progress.DoModal()==IDOK)\r
index 593df64..52b6996 100644 (file)
@@ -35,7 +35,7 @@ bool PullCommand::Execute()
                CString url;\r
                url=dlg.m_RemoteURL;\r
                CString cmd;\r
-               cmd.Format(_T("git.exe pull \"%s\""),url);\r
+               cmd.Format(_T("git.exe pull \"%s\" %s"),url,dlg.m_RemoteBranchName);\r
                CProgressDlg progress;\r
                progress.m_GitCmd=cmd;\r
                if(progress.DoModal()==IDOK)\r
index 815db97..1267a00 100644 (file)
@@ -25,6 +25,7 @@ void CPullFetchDlg::DoDataExchange(CDataExchange* pDX)
        CDialog::DoDataExchange(pDX);\r
        DDX_Control(pDX, IDC_REMOTE_COMBO, this->m_Remote);\r
        DDX_Control(pDX, IDC_OTHER, this->m_Other);\r
+       DDX_Control(pDX, IDC_REMOTE_BRANCH, this->m_RemoteBranch);\r
 \r
 }\r
 \r
@@ -41,17 +42,23 @@ BOOL CPullFetchDlg::OnInitDialog()
        AddAnchor(IDC_REMOTE_COMBO, TOP_LEFT, TOP_RIGHT);\r
        AddAnchor(IDC_OTHER, TOP_LEFT,TOP_RIGHT);\r
 \r
+       AddAnchor(IDC_REMOTE_BRANCH, TOP_LEFT,TOP_RIGHT);\r
+       \r
        AddAnchor(IDOK,BOTTOM_RIGHT);\r
        AddAnchor(IDCANCEL,BOTTOM_RIGHT);\r
 \r
        CheckRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD,IDC_REMOTE_RD);\r
        m_Remote.EnableWindow(TRUE);\r
        m_Other.EnableWindow(FALSE);\r
+       m_RemoteBranch.EnableWindow(FALSE);\r
 \r
        m_Other.SetURLHistory(TRUE);\r
        m_Other.LoadHistory(_T("Software\\TortoiseGit\\History\\PullURLS"), _T("url"));\r
        m_Other.SetCurSel(0);\r
 \r
+       m_RemoteBranch.LoadHistory(_T("Software\\TortoiseGit\\History\\PullRemoteBranch"), _T("br"));\r
+       m_RemoteBranch.SetCurSel(0);\r
+\r
        if(m_IsPull)\r
                this->SetWindowTextW(_T("Pull"));\r
        else\r
@@ -76,12 +83,15 @@ void CPullFetchDlg::OnBnClickedRd()
        if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_REMOTE_RD)\r
        {\r
                m_Remote.EnableWindow(TRUE);\r
-               m_Other.EnableWindow(FALSE);;\r
+               m_Other.EnableWindow(FALSE);\r
+               m_RemoteBranch.EnableWindow(FALSE);\r
+\r
        }\r
        if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_OTHER_RD)\r
        {\r
                m_Remote.EnableWindow(FALSE);\r
                m_Other.EnableWindow(TRUE);;\r
+               m_RemoteBranch.EnableWindow(TRUE);\r
        }\r
        \r
 \r
@@ -93,11 +103,17 @@ void CPullFetchDlg::OnBnClickedOk()
        if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_REMOTE_RD)\r
        {\r
                m_RemoteURL=m_Remote.GetString();\r
+               m_RemoteBranchName.Empty();\r
                \r
        }\r
        if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_OTHER_RD)\r
        {\r
                m_Other.GetWindowTextW(m_RemoteURL);\r
+               m_RemoteBranchName=m_RemoteBranch.GetString();\r
+               \r
        }\r
+\r
+       m_Other.SaveHistory();\r
+       m_RemoteBranch.SaveHistory();\r
        this->OnOK();\r
 }\r
index 252fb39..d1cd109 100644 (file)
@@ -19,6 +19,7 @@ protected:
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
        CHistoryCombo   m_Remote;\r
        CHistoryCombo   m_Other;\r
+       CHistoryCombo   m_RemoteBranch;\r
        virtual BOOL OnInitDialog();\r
 \r
        \r
@@ -28,4 +29,5 @@ public:
        afx_msg void OnBnClickedRd();\r
        afx_msg void OnBnClickedOk();\r
        CString m_RemoteURL;\r
+       CString m_RemoteBranchName;\r
 };\r
index 86af789..3408766 100644 (file)
@@ -11,7 +11,7 @@
                        <DebugSettings\r
                                Command="$(TargetPath)"\r
                                WorkingDirectory="D:\Profiles\b20596\tortoisegit"\r
-                               CommandArguments="/command:push /path:&quot;D:\\Profiles\\b20596\\buildtest\\TortoiseGit&quot;"\r
+                               CommandArguments="/command:pull /path:&quot;D:\\Profiles\\b20596\\buildtest\\TortoiseGit&quot;"\r
                                Attach="false"\r
                                DebuggerType="3"\r
                                Remote="1"\r
index 96fa155..bec6414 100644 (file)
Binary files a/src/TortoiseProc/resource.h and b/src/TortoiseProc/resource.h differ