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

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

From: Noorul Islam K M <noorul_at_collab.net>
Date: Thu, 13 Jan 2011 15:31:11 +0530

It is known that the commands which takes multiple targets does not
behave in a consistent manner. I analyzed the behaviour of some of the
commands, to see how they works when, multiple targets are passed and
one of them is a non-existing target. Also various svn commands return
inconsistent codes to the shell (See one such issue
http://subversion.tigris.org/issues/show_bug.cgi?id=3713).

Commands are executed with three existing targets 1.txt, 2.txt and
3.txt along with non-existing target 4.txt.

** add:

noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn add 1.tx
t 4.txt 2.txt 3.txt
A 1.txt
svn: warning: '/tmp/wc/repo1.7/4.txt' not found
A 2.txt
A 3.txt
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
0

** blame:

noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn blame 1.
txt 4.txt 2.txt 3.txt
     2 noorul Adding one line
svn: The node '/tmp/wc/repo1.7/4.txt' was not found.
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
1

** cat:

noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn cat 1.tx
t 4.txt 2.txt 3.txt
Adding one line
svn: warning: '/tmp/wc/repo1.7/4.txt' is not under version control
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
0

** changelist:

noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn cl testl
ist 1.txt 4.txt 2.txt 3.txt
A [testlist] 1.txt
svn: warning: The node '/tmp/wc/repo1.7/4.txt' was not found.
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
0

** commit: Changes in 1.txt and 2.txt

noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn ci 1.txt
 4.txt 2.txt 3.txt -m "Commit"
svn: Commit failed (details follow):
svn: '/tmp/wc/repo1.7/4.txt' is not under version control
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
1

** copy:

noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn copy 1.t
xt 4.txt 2.txt 3.txt temp
svn: Path '/tmp/wc/repo1.7/4.txt' does not exist
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
1

** delete:
noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn del 1.tx
t 4.txt 2.txt 3.txt
D 1.txt
svn: '/tmp/wc/repo1.7/4.txt' does not exist
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
1

** diff:
noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn diff 1.t
xt 4.txt 2.txt 3.txt -c 2
Index: 1.txt
===================================================================
--- 1.txt (revision 1)
+++ 1.txt (revision 2)
@@ -0,0 +1 @@
+Adding one line
svn: The node '/tmp/wc/repo1.7/4.txt' was not found.
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
1
** info:
noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn info 1.t
xt 4.txt 2.txt 3.txt
Path: 1.txt
Name: 1.txt
Working Copy Root Path: /tmp/wc/repo1.7
URL: file:///tmp/repo1.7/1.txt
Repository Root: file:///tmp/repo1.7
Repository UUID: 25579947-ca24-4ba8-ad04-23900ccc89dc
Revision: 5
Node Kind: file
Schedule: normal
Last Changed Author: noorul
Last Changed Rev: 3
Last Changed Date: 2011-01-11 12:05:08 +0530 (Tue, 11 Jan 2011)
Text Last Updated: 2011-01-11 12:35:28 +0530 (Tue, 11 Jan 2011)
Checksum: dd3cee37d491d7690669eb9a5f2c3744bd851253

svn: warning: The node '/tmp/wc/repo1.7/4.txt' was not found.

Path: 2.txt
Name: 2.txt
Working Copy Root Path: /tmp/wc/repo1.7
URL: file:///tmp/repo1.7/2.txt
Repository Root: file:///tmp/repo1.7
Repository UUID: 25579947-ca24-4ba8-ad04-23900ccc89dc
Revision: 5
Node Kind: file
Schedule: normal
Last Changed Author: noorul
Last Changed Rev: 3
Last Changed Date: 2011-01-11 12:05:08 +0530 (Tue, 11 Jan 2011)
Text Last Updated: 2011-01-11 12:03:10 +0530 (Tue, 11 Jan 2011)
Checksum: 9b22e741d575bdad23521c3cdbdbf93c818291ee

Path: 3.txt
Name: 3.txt
Working Copy Root Path: /tmp/wc/repo1.7
URL: file:///tmp/repo1.7/3.txt
Repository Root: file:///tmp/repo1.7
Repository UUID: 25579947-ca24-4ba8-ad04-23900ccc89dc
Revision: 5
Node Kind: file
Schedule: normal
Last Changed Author: noorul
Last Changed Rev: 1
Last Changed Date: 2011-01-11 11:51:39 +0530 (Tue, 11 Jan 2011)
Text Last Updated: 2011-01-11 11:47:29 +0530 (Tue, 11 Jan 2011)
Checksum: da39a3ee5e6b4b0d3255bfef95601890afd80709

svn: A problem occurred; see other errors for details
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
1

** list:

noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn ls 1.txt
 4.txt 2.txt 3.txt
1.txt
svn: The node '/tmp/wc/repo1.7/4.txt' was not found.
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
1

** log: URL targets. Multiple WC targets are not allowed.
noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn log ^/ 1
.txt 4.txt 2.txt
svn: File not found: revision 5, path '/4.txt'
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
1

** revert:
noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn del 1.tx
t 2.txt 3.txt
D 1.txt
D 2.txt
D 3.txt
noorul_at_noorul:/tmp/wc/repo1.7$ ~/projects/subversion/builds/trunk/bin/svn revert 1
.txt 4.txt 2.txt 3.txt
Reverted '1.txt'
Skipped '4.txt'
Reverted '2.txt'
Reverted '3.txt'
noorul_at_noorul:/tmp/wc/repo1.7$ echo $?
0

** Summary:

Most of the commands did not proceed with next target when one of them
is non-existing.

| 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 |

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.

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

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 am sending out this mail so that we can decide on a generic
behaviour. Any thoughts?

Thanks and Regards
Noorul
Received on 2011-01-13 11:02:31 CET

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