1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2013, 2016 - TortoiseGit
4 // Copyright (C) 2007-2008 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "AddCommand.h"
24 #include "GitProgressDlg.h"
25 #include "ProgressCommands/AddProgressCommand.h"
26 #include "ShellUpdater.h"
28 bool AddCommand::Execute()
31 if (parser
.HasKey(L
"noui"))
35 ProjectProperties props
;
36 props
.ReadPropsPathList(pathList
);
37 bRet
= !!svn
.Add(pathList
, &props
, svn_depth_empty
, FALSE
, FALSE
, TRUE
);
38 CShellUpdater::Instance().AddPathsForUpdate(pathList
);
43 if (pathList
.AreAllPathsFiles())
45 CGitProgressDlg progDlg
;
46 theApp
.m_pMainWnd
= &progDlg
;
47 AddProgressCommand addCommand
;
48 progDlg
.SetCommand(&addCommand
);
49 addCommand
.SetPathList(pathList
);
50 progDlg
.SetItemCount(pathList
.GetCount());
53 bRet
= !progDlg
.DidErrorsOccur();
58 dlg
.m_pathList
= pathList
;
59 if (dlg
.DoModal() == IDOK
)
61 if (dlg
.m_pathList
.IsEmpty())
63 CGitProgressDlg progDlg
;
64 theApp
.m_pMainWnd
= &progDlg
;
65 AddProgressCommand addCommand
;
66 progDlg
.SetCommand(&addCommand
);
67 addCommand
.SetPathList(dlg
.m_pathList
);
68 progDlg
.SetItemCount(dlg
.m_pathList
.GetCount());
71 bRet
= !progDlg
.DidErrorsOccur();
76 CShellUpdater::Instance().Flush();