/// <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.ImportModuleCommand importCommand; try { this.ParseOptions(this.unparsedOptions); CurrentWorkingDirectory = new WorkingDirectory(this.cvsRoot, Environment.CurrentDirectory, this.repository); Manager manager = new Manager(Environment.CurrentDirectory); DirectoryInfo importDir = new DirectoryInfo(Environment.CurrentDirectory); if (!importDir.Exists) { ConsoleMain.ExitProgram("Import directory does not exist."); } CurrentWorkingDirectory.Folders = manager.FetchFilesToAdd(importDir.FullName); importCommand = new ICSharpCode.SharpCvsLib.Commands.ImportModuleCommand( CurrentWorkingDirectory, this.message); importCommand.VendorString = this.vendor; importCommand.ReleaseString = this.release; importCommand.LogMessage = this.message; // importCommand.Repository = this.repository; } catch (Exception e) { LOGGER.Error(e); throw e; } return(importCommand); }
/// <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.ImportModuleCommand importCommand; try { this.ParseOptions(this.unparsedOptions); CurrentWorkingDirectory = new WorkingDirectory( this.cvsRoot, Environment.CurrentDirectory, this.repository); Manager manager = new Manager(Environment.CurrentDirectory); DirectoryInfo importDir = new DirectoryInfo(Environment.CurrentDirectory); if (!importDir.Exists) { ConsoleMain.ExitProgram("Import directory does not exist."); } CurrentWorkingDirectory.Folders = manager.FetchFilesToAdd(importDir.FullName); importCommand = new ICSharpCode.SharpCvsLib.Commands.ImportModuleCommand( CurrentWorkingDirectory, this.message); importCommand.VendorString = this.vendor; importCommand.ReleaseString = this.release; importCommand.LogMessage = this.message; // importCommand.Repository = this.repository; } catch (Exception e) { LOGGER.Error (e); throw e; } return importCommand; }