/// <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() { ICSharpCode.SharpCvsLib.Commands.RemoveCommand removeCommand; this.ParseOptions(this.unparsedOptions); try { String currentDirectory = Environment.CurrentDirectory; Entry removeEntry; // Open the Repository file in the CVS directory Manager manager = new Manager(currentDirectory); Repository repository = manager.FetchRepository(currentDirectory); removeEntry = manager.FetchEntry(currentDirectory, fileNames); // If this fails error out and state the user // is not in a CVS repository directory tree. CurrentWorkingDirectory = new WorkingDirectory(this.cvsRoot, currentDirectory, repository.FileContents); // Create new RemoveCommand object removeCommand = new ICSharpCode.SharpCvsLib.Commands.RemoveCommand( this.CurrentWorkingDirectory, currentDirectory, removeEntry); } catch (Exception e) { LOGGER.Error(e); throw e; } return(removeCommand); }
/// <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 () { ICSharpCode.SharpCvsLib.Commands.RemoveCommand removeCommand; this.ParseOptions(this.unparsedOptions); try { String currentDirectory = Environment.CurrentDirectory; Entry removeEntry; // Open the Repository file in the CVS directory Manager manager = new Manager(currentDirectory); Repository repository = manager.FetchRepository(currentDirectory); removeEntry = manager.FetchEntry(currentDirectory, fileNames ); // If this fails error out and state the user // is not in a CVS repository directory tree. CurrentWorkingDirectory = new WorkingDirectory( this.cvsRoot, currentDirectory, repository.FileContents); // Create new RemoveCommand object removeCommand = new ICSharpCode.SharpCvsLib.Commands.RemoveCommand( this.CurrentWorkingDirectory, currentDirectory, removeEntry); } catch (Exception e) { LOGGER.Error (e); throw e; } return removeCommand; }