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

Re: SVN question

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 24 May 2011 13:26:01 +0300

Varnau, Steve (Neoview) wrote on Mon, May 23, 2011 at 22:22:36 +0000:
>
>
> > -----Original Message-----
> > From: Daniel Shahaf [mailto:d.s_at_daniel.shahaf.name]
> > Sent: Monday, May 23, 2011 2:37 PM
> > To: Varnau, Steve (Neoview)
> > Cc: Hahn, Christopher (SAN DIEGO); users_at_subversion.apache.org
> > Subject: Re: SVN question
> >
> > 'svn up nonexistent' will pull in a file (inappropriately) called
> > 'nonexistent' that has been created on the server in a revision newer
> > than the BASE revision of the working copy.
>
> Quite true, but update does not complain whether or not it finds such a file. That seems a bit surprising.
>
> It also does not give an error if the current directory is not
> a working copy, and it can't figure out where to update from:
>
> > svn update foobar
> Skipped 'foobar'
>
> Okay, at least it gives a message, but not returning error, seems... surprising.
>

There has been some work on more consistently returning errors from
svn(1) in 1.7 for various invalid inputs scenarios, but this specific
case behaves the same in trunk.

> -Steve
>
> >
> > Varnau, Steve (Neoview) wrote on Mon, May 23, 2011 at 21:30:26 +0000:
> > > svn does not always return success. For instance:
> > >
> > > > svn ls
> > > svn: '.' is not a working copy
> > > > echo $?
> > > 1
> > >
> > > I think this is the more normal mode that I script against. I'm not
> > sure why the update sub-command is so forgiving.
> > >
> > > -Steve
> > >
> > > From: Hahn, Christopher (SAN DIEGO)
> > > Sent: Monday, May 23, 2011 1:54 PM
> > > To: Varnau, Steve (Neoview); users_at_subversion.apache.org
> > > Subject: RE: SVN question
> > >
> > > Steve,
> > >
> > > Thank you for taking the time.
> > >
> > > I also saw this....I was wondering what users do to get something
> > similar working.
> > >
> > > The same thing happens under Perforce. The command "p4" always
> > returns a
> > > successful exit code. The way around that is the odd "-s" switch
> > which causes the
> > > tool to emit a string like "exit: #" where the underlying commands
> > success or failure
> > > was specified. Is there perhaps some similar technique for SVN?
> > >
> > > I checked the svn Global Options and did not see anything similar.
> > >
> > > I suppose that I can just use a pipe and watch for strings that I
> > expect.....
> > >
> > > Take care,
> > >
> > > Christopher
> > >
> > > From: Varnau, Steve (Neoview)
> > > Sent: Monday, May 23, 2011 1:33 PM
> > > To: Hahn, Christopher (SAN DIEGO); users_at_subversion.apache.org
> > > Subject: RE: SVN question
> > >
> > > Christopher,
> > >
> > > The problem is not with your perl code. Apparently, update returns
> > success if you give it a path that does not exist in the current working
> > directory.
> > >
> > >
> > > Ø svn update foobar
> > >
> > > At revision 3158.
> > >
> > > Ø echo $?
> > >
> > > 0
> > >
> > > For Svn 1.6.15, anyway. Seems to hold for linux & windows.
> > >
> > > -Steve
> > >
> > > From: Hahn, Christopher (SAN DIEGO)
> > > Sent: Monday, May 23, 2011 11:34 AM
> > > To: users_at_subversion.apache.org
> > > Subject: SVN question
> > >
> > > Hello,
> > >
> > > I have been wondering how best to capture errors from
> > > the SVN command line.
> > >
> > > I wanted to show you how a basic test is failing.
> > >
> > > Consider the simple code snippet:
> > > ==========================================
> > > use strict;
> > > my $options=" --username builduser --password XXXX";
> > >
> > > chdir("C:\\source");
> > > my $output = `svn update --depth=infinity mang $options`;
> > >
> > > die "svn failed with errorcode $?" if $?;
> > > print "We survived!\n";
> > > ==========================================
> > >
> > > This command works if the "mang" above is changed to "main"
> > > (which does exist at c:\source).
> > >
> > > However, both code have this result:
> > > ==========================================
> > > C:\source\cm\script>perl svntest.pl
> > > We survived!
> > >
> > > C:\source\cm\script>perl svntest.pl
> > > We survived!
> > > ==========================================
> > >
> > > What am I doing wrong?
> > >
> > > Chris
> > >
> > > ________________________________
> > >
> > > [cid:image001.png_at_01CAF080.AD65F1E0]
> > >
> > > Christopher Hahn
> > > The Dude
> > > Software Production Engineering
> > > R&D Services, Hewlett-Packard
> > > Phone: 858-655-4096
> > > Cell: 619-630-9791
> > > chahn_at_hp.com<mailto:christopher.hahn_at_hp.com>
> > >
> > > Visit our SPE
> > Portal<http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>
> > >
> > > ________________________________
> > >
> > >
> > >
> >
>
Received on 2011-05-24 12:26:41 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.