Accurev: How to keep/promote with a multi line comment from the command line?

StackOverflow https://stackoverflow.com/questions/19108094

  •  29-06-2022
  •  | 
  •  

Domanda

How to keep/promote with a multi line comment from the accurev command line?

For example if I try:

accurev stat -n -fl | xargs accurev keep -c "git log 1234..4311"

I simple get the error:

You can not use non-printable characters on the command line: # On branch master\x0a... AccuRev was unable to understand your command.

I can of course strip out the new lines but then the comment is not really useful.

È stato utile?

Soluzione 2

I'm not sure about doing it directly from the command-line without any extra step, and I'm hesitant to try anything on my client's AccuRev setup. That said, according to the entry on accurev keep from the CLI manual:

 –c <comment>
 Specify a comment for the transaction. The next command-line argument should be 
 a quoted string. Alternatively, the next argument can be in the form 
 @<comment-file>, which uses the contents of text-file <comment-file> as the 
 comment.

 Default: enter a comment interactively, using the text editor named in 
 environment variable EDITOR (or a system-dependent default editor).

Reading this, I see two ways you can do what you want from the command line (meaning, not using the GUI).

1.) Pipe or cat your stat info into file, the use the @file syntax to get it into your commit

2.) Get your stat into into your clipboard, then don't give an argument to the keep command, let your editor open up, paste, save, and close.

There may be a way to get this all done via CLI without these middle-steps (perhaps you need to format the \x0a into \r\n or something?), but as I said, I'm unwilling to try it on my AccuRev setup as AccuRev gives me (and everyone else) enough trouble as it is.

HTH

Altri suggerimenti

AccuRev commands that take a -c option for a comment must currently be enclosed in quotes and have no line breaks.

As for the output from git log 1234..4311 that could be captured as a manifest file and kept with the other files.

Dave

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top