| 1 |
// SvnTest, a client program used to test SubversionSharp library |
|---|
| 2 |
#region Copyright (C) 2004 SOFTEC sa. |
|---|
| 3 |
// |
|---|
| 4 |
// SvnTest, a client program used to test SubversionSharp library |
|---|
| 5 |
// Copyright 2004 by SOFTEC sa |
|---|
| 6 |
// |
|---|
| 7 |
// This program is free software; you can redistribute it and/or |
|---|
| 8 |
// modify it under the terms of the GNU General Public License as |
|---|
| 9 |
// published by the Free Software Foundation; either version 2 of |
|---|
| 10 |
// the License, or (at your option) any later version. |
|---|
| 11 |
// |
|---|
| 12 |
// This program is distributed in the hope that it will be useful, |
|---|
| 13 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|---|
| 15 |
// See the GNU General Public License for more details. |
|---|
| 16 |
// |
|---|
| 17 |
// You should have received a copy of the GNU General Public |
|---|
| 18 |
// License along with this program; if not, write to the Free Software |
|---|
| 19 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 20 |
// |
|---|
| 21 |
// Sources, support options and lastest version of the complete library |
|---|
| 22 |
// is available from: |
|---|
| 23 |
// http://www.softec.st/SubversionSharp |
|---|
| 24 |
// |
|---|
| 25 |
// |
|---|
| 26 |
// Initial authors : |
|---|
| 27 |
// Denis Gervalle |
|---|
| 28 |
// Olivier Desaive |
|---|
| 29 |
#endregion |
|---|
| 30 |
// |
|---|
| 31 |
using System; |
|---|
| 32 |
using System.Collections; |
|---|
| 33 |
using System.IO; |
|---|
| 34 |
using Mono.GetOptions; |
|---|
| 35 |
using Softec.AprSharp; |
|---|
| 36 |
using Softec.SubversionSharp; |
|---|
| 37 |
|
|---|
| 38 |
namespace Softec.SubversionSharp.Test { |
|---|
| 39 |
|
|---|
| 40 |
[SubCommand("add", |
|---|
| 41 |
@"PATH... |
|---|
| 42 |
Put files and directories under version control, scheduling |
|---|
| 43 |
them for addition to repository. They will be added in next commit." |
|---|
| 44 |
)] |
|---|
| 45 |
class AddCmd : CmdBase |
|---|
| 46 |
{ |
|---|
| 47 |
[Option("operate on single directory only", 'N', "non-recursive")] |
|---|
| 48 |
public bool oNoRecurse { |
|---|
| 49 |
set { oRecurse = !value; } |
|---|
| 50 |
} |
|---|
| 51 |
public bool oRecurse = true; |
|---|
| 52 |
|
|---|
| 53 |
protected override int Execute() |
|---|
| 54 |
{ |
|---|
| 55 |
int nbPath = RemainingArguments.Length; |
|---|
| 56 |
|
|---|
| 57 |
for(int i=1; i<nbPath; i++) |
|---|
| 58 |
{ |
|---|
| 59 |
try |
|---|
| 60 |
{ |
|---|
| 61 |
client.Add(new SvnPath(RemainingArguments[i], client.Pool), oRecurse); |
|---|
| 62 |
} |
|---|
| 63 |
catch( Exception e ) |
|---|
| 64 |
{ |
|---|
| 65 |
if( oDebug ) |
|---|
| 66 |
Console.WriteLine(e); |
|---|
| 67 |
else |
|---|
| 68 |
Console.WriteLine(e.Message); |
|---|
| 69 |
} |
|---|
| 70 |
client.Clear(); |
|---|
| 71 |
} |
|---|
| 72 |
return(0); |
|---|
| 73 |
} |
|---|
| 74 |
} |
|---|
| 75 |
} |
|---|