1

Closed

Add CommitMessage to SVN Copy

description

<Svn TaskAction="Copy" Items="$(SvnTrunkUrl)" Destination="$(SvnSnapshotsUrl)/it-$(AppVersion)" />
Results in:
E205001- Cannot invoke editor to get log message when non-interactive

When invoking svn.exe -copy with -non-interactive there should always be a commit message that is specified with the -m flag.

Solution:
<Svn TaskAction="Copy" Items="$(SvnTrunkUrl)" Destination="$(SvnSnapshotsUrl)/it-$(AppVersion)"  CommitMessage="This fixes my issue"/>
The CommitMessage property should be used like TaskAction="Commit"
Closed Apr 20, 2014 at 1:35 PM by mikeFourie

comments

Piels wrote Apr 9, 2014 at 7:20 AM

Solution:
private void ExecCopy()
        {
            // required params
            if (this.Items == null || this.Items.Length == 0 || this.Destination == null)
            {
                Log.LogError("The Items and Destination parameters are required");
                return;
            }

            if (string.IsNullOrWhiteSpace(this.CommitMessage))
            {
                this.CommitMessage = DefaultCommitMessage;
            }

            if (this.CommitMessage.Contains("\""))
            {
                Log.LogError("There appears to be quotes in the commit message. This is not supported yet.");
                return;
            }

            // execute the tool
            var cmd = this.CreateCommandLineBuilder();
            cmd.AppendSwitch("copy");
            cmd.AppendSwitch("--non-interactive");
            cmd.AppendSwitch("-m");
            cmd.AppendFixedParameter("\"" + this.CommitMessage + "\"");
            cmd.AppendFileNamesIfNotNull(this.Items, " ");
            cmd.AppendFileNameIfNotNull(this.Destination);
            Utilities.ExecuteWithLogging(this.Log, Path.Combine(SvnPath, SvnExecutableName), cmd.ToString(), true);
        }

mikeFourie wrote Apr 17, 2014 at 10:59 PM

Thanks for reporting this... Mike

wrote Apr 20, 2014 at 1:34 PM

wrote Apr 20, 2014 at 1:35 PM

Resolved with changeset 88003: Subversion\Svn.cs: Add support for CommitMessage with Copy