[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn command line client's inconsistent behavior in handling multiple targets.

From: Stefan Sperling <stsp_at_elego.de>
Date: Thu, 13 Jan 2011 11:50:27 +0100

On Thu, Jan 13, 2011 at 03:31:11PM +0530, Noorul Islam K M wrote:
> | Command | Return Code | Continue |
> |------------+-------------+----------|
> | add | 0 | Y |
> | blame | 1 | N |
> | cat | 1 | Y |
> | changelist | 0 | N |
> | commit | 1 | N |
> | copy | 1 | N |
> | delete | 1 | N |
> | diff | 1 | N |
> | info | 1 | Y |
> | list | 1 | N |
> | log | 1 | N |
> | revert | 0 | Y |

Nice overview, thanks for putting this together!

> The commands add, cat, info and revert continues execution even if it
> finds one of the targets non-existing. All of them returns 0 to the
> shell except 'info' which returns 1. Also info prints
>
> svn: A problem occurred; see other errors for details
>
> at the end of the execution which tells the user that something went
> wrong during execution. This is not the case with 'add', 'cat' and
> 'revert'. I think these three commands also should return 1 and print
> the message which 'info' does, so that users does not have to scroll
> up to see the warnings to decide something went wrong.

+1 on making more commands print a "problem occured" message at the end.

I also think that all commands should exit 1 if one of the specified
targets could not be found. This makes it much easier to detect such
errors in shell scripts.

> Among these revert prints 'Skipped' message and others print 'svn:
> warning: ..' message.

Hmm... somewhat inconsistent, but I don't think we need consistency
here. Either way of putting it ("skipped" or "warning") is fine.

> I think commit operation is an atomic one, therefore it does make
> sense when it errors out when one of the target is invalid.
>
> I am not sure why all the other commands errors out when one of the
> targets is non-existing.

I think any command that tries to make a commit should error out.
This includes copy and delete, because they can make commits without
a working copy.

Commands that operate on the working copy (including copy and delete!)
should continue, print a "warning" or "skipped" message, and print
the "problem occured" message at the end.

Stefan
Received on 2011-01-13 11:51:14 CET

This is an archived mail posted to the Subversion Dev mailing list.