From: Clayton H. <dr...@us...> - 2004-07-25 20:43:03
|
Update of /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15569/src/ICSharpCode/SharpCvsLib/Commands Modified Files: LogCommand.cs RLogCommand.cs XmlLogCommand.cs Added Files: ILogCommand.cs Log Message: Changed the LogReportCommand to use the rlog if a local directory does not exist of the module there is interest in. Index: LogCommand.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Commands/LogCommand.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LogCommand.cs 7 Dec 2003 12:52:19 -0000 1.6 --- LogCommand.cs 25 Jul 2004 20:42:50 -0000 1.7 *************** *** 50,54 **** /// TODO: Figure out what this is for. /// </summary> ! public class LogCommand : ICommand { private ILog LOGGER = --- 50,54 ---- /// TODO: Figure out what this is for. /// </summary> ! public class LogCommand : ICommand, ILogCommand { private ILog LOGGER = *************** *** 67,70 **** --- 67,77 ---- /// <summary> + /// The date arguments for the log command. + /// </summary> + public ICollection DateArgs { + get {return this.dateArgs;} + } + + /// <summary> /// The default branch to use for the module. /// </summary> Index: RLogCommand.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Commands/RLogCommand.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RLogCommand.cs 25 Jul 2004 17:39:40 -0000 1.1 --- RLogCommand.cs 25 Jul 2004 20:42:50 -0000 1.2 *************** *** 42,149 **** namespace ICSharpCode.SharpCvsLib.Commands { /// <summary> ! /// Recursively tags a given module. ! /// </summary> ! public class RLogCommand : ICommand { private WorkingDirectory workingDirectory; ! private ILog LOGGER = LogManager.GetLogger (typeof (RTagCommand)); - private class Options { - public const String CLEAR_TAG = "-a"; - public const String CREATE_BRANCH = "-b"; - public const String DELETE_TAG = "-d"; - } /// <summary> ! /// Perform an rtag against the repository. The rtag command has a number ! /// of request options that may be specified. These are translated into ! /// boolean values where possible to calling classes. A summary of ! /// available command options is listed below and is listed in the private ! /// options classes. ! /// ! /// -D date ! /// Tag the most recent revision no later than date. ! /// -f ! /// Only useful with the `-D date' or `-r tag' flags. ! /// If no matching revision is found, use the most recent ! /// revision (instead of ignoring the file). ! /// -F ! /// Overwrite an existing tag of the same name on a different ! /// revision. ! /// -l ! /// Local; run only in current working directory. ! /// -n ! /// Do not run any tag program that was specified with the `-t' ! /// flag inside the `modules' file. (see section The modules ! /// file). ! /// -R ! /// Tag directories recursively. This is on by default. ! /// -r tag ! /// Only tag those files that contain tag. This can be used to ! /// rename a tag: tag only the files identified by the old tag, ! /// then delete the old tag, leaving the new tag on exactly the ! /// same files as the old tag. ! /// ! /// In addition to the above common options, these options are ! /// available: ! /// ! /// -a ! /// Use the `-a' option to have rtag look in the `Attic' ! /// (see section The attic) for removed files that contain the ! /// specified tag. The tag is removed from these files, which ! /// makes it convenient to re-use a symbolic tag as development ! /// continues (and files get removed from the up-coming ! /// distribution). ! /// -b ! /// Make the tag a branch tag. See section Branching and merging. ! /// -d ! /// Delete the tag instead of creating it. In general, tags ! /// (often the symbolic names of software distributions) should ! /// not be removed, but the `-d' option is available as a means ! /// to remove completely obsolete symbolic names if necessary ! /// (as might be the case for an Alpha release, or if you ! /// mistagged a module). ! /// /// </summary> ! /// <param name="workingDirectory">The working directory which contains ! /// the repository information.</param> ! public RLogCommand(WorkingDirectory workingDirectory) { this.workingDirectory = workingDirectory; } - private bool deleteTag = false; - /// <summary> - /// <code>true</code> if the given tag should be deleted; defaults to - /// <code>false</code>. - /// </summary> - public bool DeleteTag { - get {return this.deleteTag;} - set {this.deleteTag = value;} - } - - private String tagName; - /// <summary> - /// The name of the tag. - /// </summary> - public String TagName { - get {return this.tagName;} - set {this.tagName = value;} - } - /// <summary> /// Execute checkout module command. /// </summary> /// <param name="connection">Server connection</param> ! public void Execute(ICommandConnection connection) { ! connection.SubmitRequest(new CaseRequest()); ! if (this.deleteTag) { ! connection.SubmitRequest(new ArgumentRequest(Options.DELETE_TAG)); } - connection.SubmitRequest(new ArgumentRequest(TagName)); connection.SubmitRequest(new ArgumentRequest(workingDirectory.ModuleName)); ! connection.SubmitRequest(new RTagRequest()); } --- 42,122 ---- namespace ICSharpCode.SharpCvsLib.Commands { /// <summary> ! /// Recursively create a log of each file in the given module. ! /// ! /// Usage: cvs rlog [-lRhtNbT] [-r[revisions]] [-d dates] [-s states] ! /// [-w[logins]] [files...] ! /// -l Local directory only, no recursion. ! /// -R Only print name of RCS file. ! /// -h Only print header. ! /// -t Only print header and descriptive text. ! /// -T Use local time not GMT. ! /// -S Supress header information when no revisions are selected. ! /// -N Do not list tags. ! /// -b Only list revisions on the default branch. ! /// -r[revisions] Specify revision(s)s to list. ! /// rev1:rev2 Between rev1 and rev2, including rev1 and rev2. ! /// rev1::rev2 Between rev1 and rev2, excluding rev1 and rev2. ! /// rev1:::rev2 Between rev1 and rev2, excluding rev1. ! /// rev: rev and following revisions on the same branch. ! /// rev:: After rev on the same branch. ! /// :rev rev and previous revisions on the same branch. ! /// ::rev Before rev on the same branch. ! /// rev Just rev. ! /// branch All revisions on the branch. ! /// branch. The last revision on the branch. ! /// -d dates Specify dates (D1<D2 for range, D for latest before). ! /// -s states Only list revisions with specified states. ! /// -w[logins] Only list revisions checked in by specified logins. ! /// ! /// </summary> ! public class RLogCommand : LogCommand, ILogCommand { private WorkingDirectory workingDirectory; ! private ILog LOGGER = LogManager.GetLogger (typeof (RLogCommand)); /// <summary> ! /// /// </summary> ! /// <param name="workingDirectory"></param> ! /// <param name="module"></param> ! public RLogCommand(WorkingDirectory workingDirectory, string module) : base(workingDirectory, null, null) { this.workingDirectory = workingDirectory; } /// <summary> /// Execute checkout module command. /// </summary> /// <param name="connection">Server connection</param> ! public new void Execute(ICommandConnection connection) { ! string relativeDirectory = this.workingDirectory.ModuleName; ! // Note: don't use Path.Combine() as the separator must be "/" ! string repositoryDir = workingDirectory.CvsRoot.CvsRepository + "/" + relativeDirectory; ! connection.SubmitRequest(new DirectoryRequest(relativeDirectory, repositoryDir)); ! ! if (DefaultBranch) { ! connection.SubmitRequest(new ArgumentRequest("-b")); ! } ! if (HeaderAndDescOnly) { ! connection.SubmitRequest(new ArgumentRequest("-t")); ! } ! if (HeaderOnly) { ! connection.SubmitRequest(new ArgumentRequest("-h")); ! } ! if (NoTags) { ! connection.SubmitRequest(new ArgumentRequest("-N")); ! } ! ! // add any date arguments ! foreach (object o in DateArgs) { ! string dateArg = (string)o; ! connection.SubmitRequest(new ArgumentRequest("-d")); ! connection.SubmitRequest(new ArgumentRequest(dateArg)); } connection.SubmitRequest(new ArgumentRequest(workingDirectory.ModuleName)); ! connection.SubmitRequest(new RLogRequest()); } Index: XmlLogCommand.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Commands/XmlLogCommand.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlLogCommand.cs 25 Jul 2004 17:39:40 -0000 1.1 --- XmlLogCommand.cs 25 Jul 2004 20:42:50 -0000 1.2 *************** *** 119,125 **** /// working "sandbox" of the remote cvs repository.</param> /// <param name="module">Module to report on.</param> ! public XmlLogCommand(WorkingDirectory workingDirectory, string module) ! { ! this.cvsChangeLog = new CvsChangeLog(workingDirectory.LocalDirectory, module); } --- 119,124 ---- /// working "sandbox" of the remote cvs repository.</param> /// <param name="module">Module to report on.</param> ! public XmlLogCommand(WorkingDirectory workingDirectory, string module) { ! this.cvsChangeLog = new CvsChangeLog(workingDirectory, module); } --- NEW FILE: ILogCommand.cs --- #region "Copyright" // ILogCommand.cs // Copyright (C) 2004 Clayton Harbour // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. // // <author>Clayton Harbour {cla...@sp...}</author> #endregion using System; using System.Collections; namespace ICSharpCode.SharpCvsLib.Commands { /// <summary> /// Interface for the log and rlog commands. /// </summary> public interface ILogCommand : ICommand { /// <summary> /// The date arguments for the log command. /// </summary> ICollection DateArgs {get;} /// <summary> /// The default branch to use for the module. /// </summary> bool DefaultBranch {get;set;} /// <summary> /// Indicate <code>true</code> if only the headers and descriptions are to be output. /// </summary> bool HeaderAndDescOnly {get;set;} /// <summary> /// Indicate <code>true</code> if only the headers are to be output. /// </summary> bool HeaderOnly {get;set;} /// <summary> /// Indicate <code>true</code> if the tags should not be output. /// </summary> bool NoTags {get;set;} /// <summary> /// Adds a date range using exclusive dates. /// This is equivalent to the command line option "-d startDate<endDate" /// /// <param name="startDate"></param> /// <param name="endDate"></param> /// </summary> void AddExclusiveDateRange(DateTime startDate, DateTime endDate); /// <summary> /// Adds a open ended date range with an exclusive start date. /// This is equivalent to the command line option "-d startDate<" /// /// <param name="startDate"></param> /// </summary> void AddExclusiveDateStart(DateTime startDate); /// <summary> /// Adds a open ended date range with an exclusive start date. /// This is equivalent to the command line option "-d <endDate" /// /// <param name="endDate"></param> /// </summary> void AddExclusiveDateEnd(DateTime endDate); /// <summary> /// Adds a date range using inclusive dates. /// This is equivalent to the command line option "-d startDate<=endDate" /// /// <param name="startDate"></param> /// <param name="endDate"></param> /// </summary> void AddInclusiveDateRange(DateTime startDate, DateTime endDate); /// <summary> /// Adds a open ended date range with an inclusive start date. /// This is equivalent to the command line option "-d startDate<=" /// /// <param name="startDate"></param> /// </summary> void AddInclusiveDateStart(DateTime startDate); /// <summary> /// Adds a open ended date range with an inclusive start date. /// This is equivalent to the command line option "-d <=endDate" /// /// <param name="endDate"></param> /// </summary> void AddInclusiveDateEnd(DateTime endDate); /// <summary> /// Adds a single date to specify the most recent revision at or prior to this date. /// This is equivalent to the command line option "-d date" /// /// <param name="date"></param> /// </summary> void AddDate(DateTime date); } } |