From 54b7a31d93340ed42270d58e17530a20c14baa56 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 6 Aug 2011 22:09:21 +0200 Subject: [PATCH] allow to clone recursively Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/Resources/TortoiseProcENG.rc | 4 +++- src/TortoiseProc/CloneDlg.cpp | 7 +++++++ src/TortoiseProc/CloneDlg.h | 2 ++ src/TortoiseProc/Commands/CloneCommand.cpp | 13 ++++++++++--- src/TortoiseProc/resource.h | 1 + 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 27f65589a..c47e39e01 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -1,6 +1,7 @@ = Release 1.7.2.0 = == Features == * Added shortcuts to the Windows 7 taskbar jumplist + * Allow to clone recursively * Fixed issue #841: Pull dialog should have "no fast-forward" option like the merge dialog == Bug Fix == diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index e6696ccd5..0f623f0f5 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -1531,7 +1531,8 @@ BEGIN PUSHBUTTON "Bro&wse",IDC_CLONE_DIR_BROWSE,253,46,50,15 CONTROL "depth ",IDC_CHECK_DEPTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,70,32,10 EDITTEXT IDC_EDIT_DEPTH,90,68,32,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Clone into Bare Repo",IDC_CHECK_BARE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,165,70,81,9 + CONTROL "Recursive",IDC_CHECK_RECURSIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,134,70,49,9 + CONTROL "Clone into Bare Repo",IDC_CHECK_BARE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,197,70,81,9 CONTROL "Load Putty &Key",IDC_PUTTYKEY_AUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,96,62,10 CONTROL "",IDC_PUTTYKEYFILE,"ComboBoxEx32",CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP,82,95,164,59 PUSHBUTTON "...",IDC_PUTTYKEYFILE_BROWSE,253,94,16,15 @@ -2899,6 +2900,7 @@ BEGIN VERTGUIDE, 303 TOPMARGIN, 7 BOTTOMMARGIN, 199 + HORZGUIDE, 79 END IDD_GITPROGRESS, DIALOG diff --git a/src/TortoiseProc/CloneDlg.cpp b/src/TortoiseProc/CloneDlg.cpp index ffa46a481..bcb66e036 100644 --- a/src/TortoiseProc/CloneDlg.cpp +++ b/src/TortoiseProc/CloneDlg.cpp @@ -35,6 +35,7 @@ CCloneDlg::CCloneDlg(CWnd* pParent /*=NULL*/) { m_bAutoloadPuttyKeyFile = CAppUtils::IsSSHPutty(); + m_bRecursive = FALSE; m_bBare = FALSE; m_bSVN = FALSE; m_bSVNTrunk = FALSE; @@ -81,6 +82,7 @@ void CCloneDlg::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_CHECK_DEPTH, m_bDepth); DDX_Check(pDX, IDC_CHECK_BARE, m_bBare); + DDX_Check(pDX, IDC_CHECK_RECURSIVE, m_bRecursive); DDX_Text(pDX, IDC_EDIT_DEPTH,m_nDepth); } @@ -161,6 +163,7 @@ BEGIN_MESSAGE_MAP(CCloneDlg, CHorizontalResizableStandAloneDialog) ON_BN_CLICKED(IDC_CHECK_SVN_FROM, &CCloneDlg::OnBnClickedCheckSvnFrom) ON_BN_CLICKED(IDC_CHECK_DEPTH, &CCloneDlg::OnBnClickedCheckDepth) ON_BN_CLICKED(IDC_CHECK_BARE, &CCloneDlg::OnBnClickedCheckBare) + ON_BN_CLICKED(IDC_CHECK_RECURSIVE, &CCloneDlg::OnBnClickedCheckRecursive) ON_BN_CLICKED(IDC_CHECK_USERNAME, &CCloneDlg::OnBnClickedCheckUsername) END_MESSAGE_MAP() @@ -388,6 +391,10 @@ void CCloneDlg::OnBnClickedCheckSvnFrom() this->GetDlgItem(IDC_EDIT_SVN_FROM)->EnableWindow(this->m_bSVNFrom&&this->m_bSVN); } +void CCloneDlg::OnBnClickedCheckRecursive() +{ + UpdateData(TRUE); +} void CCloneDlg::OnBnClickedCheckBare() { UpdateData(TRUE); diff --git a/src/TortoiseProc/CloneDlg.h b/src/TortoiseProc/CloneDlg.h index 0e65e0756..5d9b07453 100644 --- a/src/TortoiseProc/CloneDlg.h +++ b/src/TortoiseProc/CloneDlg.h @@ -68,6 +68,7 @@ public: BOOL m_bDepth; BOOL m_bSVNUserName; BOOL m_bBare; + BOOL m_bRecursive; int m_nDepth; @@ -86,6 +87,7 @@ protected: afx_msg void OnBnClickedPuttykeyAutoload(); afx_msg void OnCbnEditchangeUrlcombo(); + afx_msg void OnBnClickedCheckRecursive(); afx_msg void OnBnClickedCheckBare(); afx_msg void OnBnClickedCheckSvn(); afx_msg void OnBnClickedCheckSvnTrunk(); diff --git a/src/TortoiseProc/Commands/CloneCommand.cpp b/src/TortoiseProc/Commands/CloneCommand.cpp index 8e09dd246..036c636fd 100644 --- a/src/TortoiseProc/Commands/CloneCommand.cpp +++ b/src/TortoiseProc/Commands/CloneCommand.cpp @@ -1,6 +1,6 @@ -// TortoiseSVN - a Windows shell extension for easy version control +// TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2007-2008 - TortoiseSVN +// Copyright (C) 2008-2011 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -34,6 +34,12 @@ bool CloneCommand::Execute() dlg.m_Directory=this->orgCmdLinePath.GetWinPathString(); if(dlg.DoModal()==IDOK) { + CString recursiveStr; + if(dlg.m_bRecursive) + recursiveStr = _T("--recursive"); + else + recursiveStr = _T(""); + CString BareStr; if(dlg.m_bBare) BareStr = _T("--bare"); @@ -75,7 +81,8 @@ bool CloneCommand::Execute() progressarg = _T("--progress"); - cmd.Format(_T("git.exe clone %s %s -v %s \"%s\" \"%s\""), + cmd.Format(_T("git.exe clone %s %s %s -v %s \"%s\" \"%s\""), + recursiveStr, BareStr, progressarg, depth, diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index 81f0e2e4c..02f521b46 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -1180,6 +1180,7 @@ #define IDC_MSYSGIT_EXTERN_PATH 1652 #define IDC_CHECK_BARE 1653 #define IDC_INIT_REPO_DESC 1654 +#define IDC_CHECK_RECURSIVE 1654 #define IDC_CHECK_IGNORE_WHITE_SPACE 1655 #define IDC_CHECK_3WAY 1656 #define IDC_CHECK_IGNORE_SPACE 1657 -- 2.11.4.GIT