/// <summary> /// Create the command object that will be used to act on the repository. /// </summary> /// <returns>The command object that will be used to act on the /// repository.</returns> /// <exception cref="Exception">TODO: Make a more specific exception</exception> /// <exception cref="NotImplementedException">If the command argument /// is not implemented currently. TODO: Implement the argument.</exception> public override ICommand CreateCommand () { DirectoryInfo dir = new DirectoryInfo(Path.Combine(Directory.GetCurrentDirectory(), "CVS")); UpdateCommand2 updateCommand; this.ParseOptions(this.unparsedOptions); // note the sandbox is actually above the CVS directory Manager manager = new Manager(dir.Parent); Repository repository = null; Root root = null; try { repository = Repository.Load(dir); root = Root.Load(dir); } catch (NullReferenceException) { this.InvalidRepository(); } catch (CvsFileNotFoundException) { this.InvalidRepository(); } if (null == repository) { this.InvalidRepository(); } try { this.cvsRootVar = new CvsRoot(root.FileContents); } catch (ICSharpCode.SharpCvsLib.Exceptions.CvsRootParseException) { this.InvalidRepository(); } // If this fails error out and state the user // is not in a CVS repository directory tree. if (localDirectory == null) { localDirectory = dir.Parent.FullName; } CurrentWorkingDirectory = new WorkingDirectory( this.CvsRootVar, localDirectory, repository.FileContents); if (revision != null) { CurrentWorkingDirectory.Revision = revision; } if (!date.Equals(DateTime.MinValue)) { CurrentWorkingDirectory.Date = date; } CurrentWorkingDirectory.FoldersToUpdate = manager.FetchFilesToUpdate (dir.FullName); // Create new UpdateCommand2 object updateCommand = new UpdateCommand2(CurrentWorkingDirectory); return updateCommand; }