private static String GetCommandString(SvnLookCommand command)
        {
            switch (command)
            {
            case SvnLookCommand.Author:
                return("author");

            case SvnLookCommand.Cat:
                return("cat");

            case SvnLookCommand.Changed:
                return("changed");

            case SvnLookCommand.Date:
                return("date");

            case SvnLookCommand.Diff:
                return("diff");

            case SvnLookCommand.DirsChanged:
                return("dirs-changed");

            case SvnLookCommand.History:
                return("history");

            case SvnLookCommand.Info:
                return("info");

            case SvnLookCommand.Lock:
                return("lock");

            case SvnLookCommand.Log:
                return("log");

            case SvnLookCommand.PropertyGet:
                return("propget");

            case SvnLookCommand.PropertyList:
                return("proplist");

            case SvnLookCommand.Tree:
                return("tree");

            case SvnLookCommand.UUID:
                return("uuid");

            case SvnLookCommand.Youngest:
                return("youngest");

            default:
                throw new ArgumentOutOfRangeException("command");
            }
        }
 private Process SwitchedExecuteSvnLook(SvnLookCommand command, String arguments)
 {
     if (RevisionOrTransaction is int)
     {
         return(SvnLook.Execute(command, (int)RevisionOrTransaction, arguments));
     }
     else if (RevisionOrTransaction is Transaction)
     {
         return(SvnLook.Execute(command, (Transaction)RevisionOrTransaction, arguments));
     }
     // Due to constructor logic we can never actually reach this point
     throw new InvalidOperationException("RevisionOrTransaction is not a valid type");
 }
Exemple #3
0
		public Process Execute(SvnLookCommand command, int revision, String arguments)
		{
			Trace.WriteLine(String.Format("Excuting {0} with revision {1}", command, revision));
			switch (command)
			{
				case SvnLookCommand.Lock:
					throw new InvalidOperationException("Lock cannot be called with a revision number");
				case SvnLookCommand.UUID:
					throw new InvalidOperationException("UUID cannot be called with a revision number");
				case SvnLookCommand.Youngest:
					throw new InvalidOperationException("Youngest cannot be called with a revision number");
				default: break;
			}

			arguments = String.Concat("-r ", revision, " ", arguments);

			return Execute(command, arguments);
		
		}
        public Process Execute(SvnLookCommand command, int revision, String arguments)
        {
            Trace.WriteLine(String.Format("Excuting {0} with revision {1}", command, revision));
            switch (command)
            {
            case SvnLookCommand.Lock:
                throw new InvalidOperationException("Lock cannot be called with a revision number");

            case SvnLookCommand.UUID:
                throw new InvalidOperationException("UUID cannot be called with a revision number");

            case SvnLookCommand.Youngest:
                throw new InvalidOperationException("Youngest cannot be called with a revision number");

            default: break;
            }

            arguments = String.Concat("-r ", revision, " ", arguments);

            return(Execute(command, arguments));
        }
Exemple #5
0
		public Process Execute(SvnLookCommand command, String arguments)
		{
			Trace.WriteLine(String.Format("Excuting {0} with arguments: {1}", command, arguments));
			arguments = String.Concat(
				GetCommandString(command), " \"", 
				RepositoryPath, "\" ", 
				arguments);
			
			ProcessStartInfo info = new ProcessStartInfo();
			info.Arguments = arguments;
			info.FileName = SvnLookPath;
			// Required for redirecting standard output
			info.UseShellExecute = false; 
			// Required to be able to catch the output
			info.RedirectStandardOutput = true;
			// Required to keep the called program from 
			// writing errors that destroy formatting
			// of *our* error messages.
			info.RedirectStandardError = true; 

			return Process.Start(info);
		}
        public Process Execute(SvnLookCommand command, String arguments)
        {
            Trace.WriteLine(String.Format("Excuting {0} with arguments: {1}", command, arguments));
            arguments = String.Concat(
                GetCommandString(command), " \"",
                RepositoryPath, "\" ",
                arguments);

            ProcessStartInfo info = new ProcessStartInfo();

            info.Arguments = arguments;
            info.FileName  = SvnLookPath;
            // Required for redirecting standard output
            info.UseShellExecute = false;
            // Required to be able to catch the output
            info.RedirectStandardOutput = true;
            // Required to keep the called program from
            // writing errors that destroy formatting
            // of *our* error messages.
            info.RedirectStandardError = true;

            return(Process.Start(info));
        }
		private Process SwitchedExecuteSvnLook(SvnLookCommand command, String arguments)
		{
			if(RevisionOrTransaction is int)
			{
				return SvnLook.Execute(command, (int)RevisionOrTransaction, arguments);
			}
			else if(RevisionOrTransaction is Transaction)
			{
				return SvnLook.Execute(command, (Transaction)RevisionOrTransaction, arguments);
			}
			// Due to constructor logic we can never actually reach this point
			throw new InvalidOperationException("RevisionOrTransaction is not a valid type");
		}
Exemple #8
0
		private static String GetCommandString(SvnLookCommand command)
		{

			switch (command)
			{
				case SvnLookCommand.Author:
					return "author";

				case SvnLookCommand.Cat:
					return "cat";

				case SvnLookCommand.Changed:
					return "changed";

				case SvnLookCommand.Date:
					return "date";

				case SvnLookCommand.Diff:
					return "diff";

				case SvnLookCommand.DirsChanged:
					return "dirs-changed";

				case SvnLookCommand.History:
					return "history";

				case SvnLookCommand.Info:
					return "info";

				case SvnLookCommand.Lock:
					return "lock";

				case SvnLookCommand.Log:
					return "log";

				case SvnLookCommand.PropertyGet:
					return "propget";

				case SvnLookCommand.PropertyList:
					return "proplist";

				case SvnLookCommand.Tree:
					return "tree";

				case SvnLookCommand.UUID:
					return "uuid";

				case SvnLookCommand.Youngest:
					return "youngest";

				default:
					throw new ArgumentOutOfRangeException("command");
			}

		}