Forum: Ruby SVN command not executing correctly through ruby script

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
A0529a06cce9f827f7b022f7e5036975?d=identicon&s=25 Kristen (Guest)
on 2007-06-25 04:34

Im trying to get some code working from the book "Everyday Scripting
with Ruby for Teams, Testers, and You" by Brian Marick.  The code
resides on page 85.

Basically, whats happening is that Im loading this method into irb using
load 'churn.rb':

def svn_log(subsystem, start_date)
  timespan = "-revision 'HEAD:{#{start_date}}'"
  root = "svn://"

  `svn log #{timespan} #{root}/#{subsystem}`

after its loaded, I execute the command:

svn_log('persistence', '2005-06-30')

which should return some SVN(subversion) data.  I have subversion

But instead Im getting a syntax error, which doesnt make sense since i
have spelled everything correctly (triple checked).

Here is the error:

irb(main):002:0> svn_log('persistence', '2005-06-30')
subversion/clients/cmdline/main.c:939: (apr_err=205000)
svn: Syntax error in revision argument 'evision'
=> ""

After seeing this, Im wondering if the online source even exists.  Could
someone please check this for me since Im not the sharpest tool in the
shed when it comes to Subversion just yet.

Also, any advice on how to solve this is greatly appreciated.

Thanks in advance.
B0f5d09953d14dcc7705f928d503c824?d=identicon&s=25 Mike Cahill (Guest)
on 2007-06-25 06:08
(Received via mailing list)
I haven't a clue bout any of this stuff.  But your root string looks
funky for a url.  Double slash after .org?
7b0e3a2c135e6f67edf3194ee501961d?d=identicon&s=25 Doug Phillips (Guest)
on 2007-06-25 06:19
(Received via mailing list)
>   timespan = "-revision 'HEAD:{#{start_date}}'"

According to the svn help output, the flag for revision should either be
a short -r or a long --revision

C5b20b09d5d24bd554f703ff0595696b?d=identicon&s=25 Al Cholic (desertfox)
on 2007-06-25 07:35
> a short -r or a long --revision

That was it. Thanks you very much!
This topic is locked and can not be replied to.